diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-21 02:49:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-21 03:40:15 +0200 |
commit | 5b41bb29d73eaff18f7fd8e7efe78ec82578f5d0 (patch) | |
tree | c0d8104ee94b87ac735e85cdbe37d73a85430a3c | |
parent | 1c058d94b9ea7f9cfe418495c74204c6962a6d65 (diff) | |
download | ffmpeg-5b41bb29d73eaff18f7fd8e7efe78ec82578f5d0.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)
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 739ff95cfd..c4f10f97e8 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 (unit_type == 7 || unit_type == 8) |