summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-08-21 02:49:21 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2015-10-10 01:22:43 +0200
commit17788711ac4390f490d958590e218f45199950c4 (patch)
tree3869942a66c0265508f15d9fc8ac52f148dc78ef
parent30c644afebb991b61dec313cc2d6a01971b60532 (diff)
downloadffmpeg-release/1.2.tar.gz
avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size checkrelease/1.2
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 f9c3621d3f..82b6364fae 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -150,7 +150,7 @@ pps:
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 */