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.

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com>
---
The earlier commit message claimed to be about a muxer in
avcodec/movtextdec.

I still don't know whether the STYL_BOX flag should be reset or not.

 libavcodec/movtextenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index 11db240ab7..81e8c2e802 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;
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to