diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-09-19 15:15:56 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-09-19 16:44:42 +0200 |
commit | c92a2a4eb8b883e82871c2415f757153d263b6b3 (patch) | |
tree | 463b988b95ab2eeb21af0f8a76cea75ebd4358bf /libavformat/movenc.c | |
parent | f06068bbd6ed1f831dee0b0ee46e00ebe42ec1e2 (diff) | |
download | ffmpeg-c92a2a4eb8b883e82871c2415f757153d263b6b3.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.
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 88239c5655..b79bbe83c6 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); |