aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-16 13:47:56 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:58 +0100
commitf4d7dba3ce72344e8f2c6ea3293249df6127de00 (patch)
treee2f003b1b7c9cb8c7f5898c48cf22198bf36aec6
parentbb8d18a39bee5dba0137c22f1f1fcec2254c4bc7 (diff)
downloadffmpeg-f4d7dba3ce72344e8f2c6ea3293249df6127de00.tar.gz
avcodec/movtextenc: Reset array counter after freeing array
Otherwise the mov_text encoder can segfault when given subtitles with more than one AVSubtitleRect if one of the first nb_rects - 1 rects contained a style attribute. Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit 8d4431955ccca80933a837e1bc7f44679039335b)
-rw-r--r--libavcodec/movtextenc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index 56781af1f8..92e7ca6b3e 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;