aboutsummaryrefslogtreecommitdiffstats
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-09 21:58:11 +0200
commit8b158bf62cbdc7cf66b2938041465ba269206355 (patch)
treeb92d9f0590ed95625ffbe9021d997c4a9e5ada36
parent1024bcab6272ef4656e46c432074228f5bf743a8 (diff)
downloadffmpeg-8b158bf62cbdc7cf66b2938041465ba269206355.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.c2
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)