From 3559fb97c459c88b4f1d0eef80d55933d3b7fabe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 26 Aug 2013 10:56:17 +0300 Subject: [PATCH] movenc: Check that tracks->enc exists before trying to free extradata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/movenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index dc13a4be0e..cebdca9860 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -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); }