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-10 01:15:12 +0200 |
commit | 087561a7dcaa1db0d9f87385e1e317e833971c26 (patch) | |
tree | f8b3ac527768ed7e3169e3455bb296457d257a06 | |
parent | 0b0183c5b741afea80fefef662d61e32e21a09c6 (diff) | |
download | ffmpeg-087561a7dcaa1db0d9f87385e1e317e833971c26.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 975e6e5557..2f005f213d 100644 --- a/libavcodec/h264_mp4toannexb_bsf.c +++ b/libavcodec/h264_mp4toannexb_bsf.c @@ -168,7 +168,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; /* prepend only to the first type 5 NAL unit of an IDR picture */ |