mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
56b3726ed2
commit
8d4431955c
|
@ -102,6 +102,7 @@ static void mov_text_cleanup(MovTextContext *s)
|
||||||
av_freep(&s->style_attributes[j]);
|
av_freep(&s->style_attributes[j]);
|
||||||
}
|
}
|
||||||
av_freep(&s->style_attributes);
|
av_freep(&s->style_attributes);
|
||||||
|
s->count = 0;
|
||||||
}
|
}
|
||||||
if (s->style_attributes_temp) {
|
if (s->style_attributes_temp) {
|
||||||
*s->style_attributes_temp = s->d;
|
*s->style_attributes_temp = s->d;
|
||||||
|
|
Loading…
Reference in New Issue