Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-08-21 03:49:21 +0300
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2015-10-10 02:15:12 +0300
commit087561a7dcaa1db0d9f87385e1e317e833971c26 (patch)
treef8b3ac527768ed7e3169e3455bb296457d257a06
parent0b0183c5b741afea80fefef662d61e32e21a09c6 (diff)
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.c2
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 */