diff options
author | James Almer <jamrial@gmail.com> | 2017-04-25 20:23:12 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-05-16 11:30:16 -0300 |
commit | 7f2eeb2c7478286f32c532b7c24e059cdbf59911 (patch) | |
tree | 0194647638f5d5c1c66d3ffeb9703d8ca2221fec /libavformat | |
parent | 54918674f7cbe673fcaee5ad3643e5e474548a82 (diff) | |
download | ffmpeg-7f2eeb2c7478286f32c532b7c24e059cdbf59911.tar.gz |
avformat/concatdec: fix the h264 annexb extradata check
The start code can be either in the first three or four bytes.
(cherry picked from commit b4330a0e02fcbef61d630a369abe5f4421ced659)
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/concatdec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index b3a430e5a0..9bb7556d9d 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -199,8 +199,11 @@ static int detect_stream_specific(AVFormatContext *avf, int idx) AVBitStreamFilterContext *bsf; int ret; - if (cat->auto_convert && st->codecpar->codec_id == AV_CODEC_ID_H264 && - (st->codecpar->extradata_size < 4 || AV_RB32(st->codecpar->extradata) != 1)) { + if (cat->auto_convert && st->codecpar->codec_id == AV_CODEC_ID_H264) { + if (!st->codecpar->extradata_size || + (st->codecpar->extradata_size >= 3 && AV_RB24(st->codecpar->extradata) == 1) || + (st->codecpar->extradata_size >= 4 && AV_RB32(st->codecpar->extradata) == 1)) + return 0; av_log(cat->avf, AV_LOG_INFO, "Auto-inserting h264_mp4toannexb bitstream filter\n"); if (!(bsf = av_bitstream_filter_init("h264_mp4toannexb"))) { |