]> git.sesse.net Git - ffmpeg/commitdiff
avformat/movenc: Fix segfault upon allocation error
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 28 Sep 2020 14:00:56 +0000 (16:00 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 28 Sep 2020 18:41:20 +0000 (20:41 +0200)
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/movenc.c

index 20768cd45f9ad5abc1bc2faec0374f2571048f64..2006fcee4b6c5fde76cd65d97ab991401e387c3b 100644 (file)
@@ -6254,6 +6254,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);