aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-09-19 15:15:56 +0200
committerReinhard Tartler <siretart@tauware.de>2011-09-27 20:57:08 +0200
commit9f9b731a3a2f873b3fb1e4f52e181a43fab6b89b (patch)
tree2f63988cd4606f6980822bfaf6f24293d6fbf825 /libavformat/movenc.c
parentad47a5ec854d2ec6e451690622a3484010094aa2 (diff)
downloadffmpeg-9f9b731a3a2f873b3fb1e4f52e181a43fab6b89b.tar.gz
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. (cherry picked from commit c92a2a4eb8b883e82871c2415f757153d263b6b3) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 5d9d3d1bfe..b171c2dc14 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1215,7 +1215,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);