[FFmpeg-cvslog] movenc: fix NULL reference in mov_write_tkhd_tag

Anton Khirnov git at videolan.org
Mon Sep 19 22:54:16 CEST 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Sep 19 15:15:56 2011 +0200| [c92a2a4eb8b883e82871c2415f757153d263b6b3] | committer: Anton Khirnov

movenc: fix NULL reference in mov_write_tkhd_tag

st may be NULL when there are more mov streams than AVStreams, e.g. when
chapters are present.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c92a2a4eb8b883e82871c2415f757153d263b6b3
---

 libavformat/movenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 88239c5..b79bbe8 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1217,7 +1217,7 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
     avio_wb32(pb, 0); /* reserved */
     avio_wb32(pb, 0); /* reserved */
     avio_wb16(pb, 0); /* layer */
-    avio_wb16(pb, st->codec->codec_type); /* alternate group) */
+    avio_wb16(pb, st ? st->codec->codec_type : 0); /* alternate group) */
     /* Volume, only for audio */
     if(track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
         avio_wb16(pb, 0x0100);



More information about the ffmpeg-cvslog mailing list