avformat/movenc: Fix segfault upon allocation error

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 4106013523f46824d32fd5b469ea264fbdfdb591)
This commit is contained in:
Andreas Rheinhardt 2020-09-28 16:00:56 +02:00
parent 9637dc8ebd
commit 89231df489

@ -6150,6 +6150,9 @@ static void mov_free(AVFormatContext *s)
MOVMuxContext *mov = s->priv_data;
int i;
if (!mov->tracks)
return;
if (mov->chapter_track) {
if (mov->tracks[mov->chapter_track].par)
av_freep(&mov->tracks[mov->chapter_track].par->extradata);