diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-21 02:49:21 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2015-10-09 21:48:05 +0200 |
commit | 4afa762511885e04c9f05d54be3f55d49c5a782f (patch) | |
tree | 19ac80e031721f84c3597721d70a1af651a389a2 | |
parent | bd4351b5d7784ba666b8e64b8fc25b2ca47b65c7 (diff) | |
download | ffmpeg-4afa762511885e04c9f05d54be3f55d49c5a782f.tar.gz |
avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
Fixes Ticket4778
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2bb54b82b5094fd906aa28c0443be08c95662a31)
-rw-r--r-- | libavcodec/h264_mp4toannexb_bsf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c index ae96ee953d..2187264c2f 100644 --- a/libavcodec/h264_mp4toannexb_bsf.c +++ b/libavcodec/h264_mp4toannexb_bsf.c @@ -182,7 +182,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc, buf += ctx->length_size; unit_type = *buf & 0x1f; - if (buf + nal_size > buf_end || nal_size < 0) + if (nal_size > buf_end - buf || nal_size < 0) goto fail; if (unit_type == 7) |