From patchwork Fri Oct 16 14:40:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23020 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id B0BC044A470 for ; Fri, 16 Oct 2020 17:41:44 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 860F468BA8A; Fri, 16 Oct 2020 17:41:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F150568BA62 for ; Fri, 16 Oct 2020 17:41:37 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id n15so3237343wrq.2 for ; Fri, 16 Oct 2020 07:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=y5H+eY04WwQiX8ypXZsy+PUPwZBT4kYPA8f1cgtfB34=; b=tJFWnM4kZXXk0TsANFJzEokgWHLQp2SSgIQ7s6z9Y4v0hG+MruAnRYn0Vl0wuUIfB+ Jehj+R+GwfdYXgyrm+uBUuM5pnRH7gxZPV2km1ie77xEzlL5W0ls8Khj0fepu9gHAUxS mALUJJ4+44I3m3fRJhcsrMU9amqB/WFUY0kIZwuvxb2uwHf8pBEKbTvirGRjevqaoJZl S8Ix90eSJo7615sEEp9hczC5cUCRt9mdDg0jVkoEAfPwNnPYpb3UqO/+S+6YLRpIKFK3 /m4FAWqXryPFRL4PXmCwdLYYeJLqyzaEuwSbKqSNY4XPPGHpy0BP9b555CLQRMIAZ1M2 lDuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=y5H+eY04WwQiX8ypXZsy+PUPwZBT4kYPA8f1cgtfB34=; b=EWA/QBP8NIQ8/7lq3WlBpqL5wO/CwR8Io/iHKKFNZVWbZTEDsJePFXtUa9+XqTT7lT QvdkBg3yfZsx2rvPLDgxd9Uz9IH3Dv1Ryb7Al6kH3heEOJjMu0GKXe9tuoDYMlvUz6LS svprDOCjbOF/G4PSADLDqtoGJYTdBdz8c2U/kH6jB4J0gIKOSBOYFijtPRTNwfYLrX3t K3ZOdliZzHmIEMzD93f3WPFgyRI6UkOrvUbyXFnSCErnsyL6vKCHRpEL59qtmNz4huMK I7AlSeq3pId8g0nUkXVKMik12JdAfxNsxiphmHQZgB+ZkUxzMZRP4MQVBzKh2APO/VVm WZZg== X-Gm-Message-State: AOAM530XLeEoKgM3WYPaJsIOjHmrkAuid85Zf/leDuDLAQpB9TD3Zi8t VZ5NlE/UmhiEGkB/UD6wHTMNBxz5WnY= X-Google-Smtp-Source: ABdhPJzro6m2OahFnMC6JLBcgOhgtYu4bAifst6JZDrVWuLnIYVNnd1+oF69bPJ+5sJnIFpA7yKe5A== X-Received: by 2002:adf:f44d:: with SMTP id f13mr4153530wrp.385.1602859297060; Fri, 16 Oct 2020 07:41:37 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id x64sm3025503wmg.33.2020.10.16.07.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2020 07:41:36 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 16 Oct 2020 16:40:34 +0200 Message-Id: <20201016144035.308668-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/movtextdec: Reset array counter after freeing array X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Otherwise the mov_text muxer can segfault when given subtitles with more than one AVSubtitleRect if one of the first nb_rects - 1 rects contained a style attribute. Signed-off-by: Andreas Rheinhardt --- I wonder whether we should also reset the STYL_BOX flag of s->box_flags. libavcodec/movtextenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 67d29a09ca..3cf308aac8 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -102,6 +102,7 @@ static void mov_text_cleanup(MovTextContext *s) av_freep(&s->style_attributes[j]); } av_freep(&s->style_attributes); + s->count = 0; } if (s->style_attributes_temp) { *s->style_attributes_temp = s->d;