movenc: Check that tracks->enc exists before trying to free extradata
authorMartin Storsjö <martin@martin.st>
Mon, 26 Aug 2013 07:56:17 +0000 (10:56 +0300)
committerMartin Storsjö <martin@martin.st>
Tue, 27 Aug 2013 07:26:07 +0000 (10:26 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/movenc.c

index dc13a4b..cebdca9 100644 (file)
@@ -3470,7 +3470,8 @@ static int mov_write_trailer(AVFormatContext *s)
     }
 
     if (mov->chapter_track) {
-        av_free(mov->tracks[mov->chapter_track].enc->extradata);
+        if (mov->tracks[mov->chapter_track].enc)
+            av_free(mov->tracks[mov->chapter_track].enc->extradata);
         av_freep(&mov->tracks[mov->chapter_track].enc);
     }