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 22:54:33 +0200
commit3ae3708246ec9ca46580b8ea40fd01bca31c97b3 (patch)
tree202c88093578ca18ab68e3c5ab6ccf5d7bedc181
parent57e284dac6491bff2b0127db3cf68a5beee4a24e (diff)
downloadffmpeg-3ae3708246ec9ca46580b8ea40fd01bca31c97b3.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 a003a1df1d..91605ff863 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -173,7 +173,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 (ctx->first_idr && (unit_type == 7 || unit_type == 8))