diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-21 03:49:21 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-21 04:37:32 +0300 |
commit | 2bb54b82b5094fd906aa28c0443be08c95662a31 (patch) | |
tree | 4271e2c88142829741d0b8a6297b5b8b9bb328d8 | |
parent | c8890941d63df786bb7a8cab92677416499bb7c3 (diff) |
avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
Fixes Ticket4778
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/h264_mp4toannexb_bsf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c index 1693989977..a5da84a7af 100644 --- a/libavcodec/h264_mp4toannexb_bsf.c +++ b/libavcodec/h264_mp4toannexb_bsf.c @@ -201,7 +201,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) |