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 00:56:52 +0200
commit50ac23fd7fd9292e65214cb137d7dd595e5f898b (patch)
treefc164f75244bbe70770eaeaf2e90c84cb4afd9bf
parent01fa1dc22914b6f01602df34b27f80ab1d007bbe (diff)
downloadffmpeg-50ac23fd7fd9292e65214cb137d7dd595e5f898b.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 7f72d2576e..06861b7ce3 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -174,7 +174,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 */