Commit 2bb54b82 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check

Fixes Ticket4778
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent c8890941
...@@ -201,7 +201,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc, ...@@ -201,7 +201,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
buf += ctx->length_size; buf += ctx->length_size;
unit_type = *buf & 0x1f; unit_type = *buf & 0x1f;
if (buf + nal_size > buf_end || nal_size < 0) if (nal_size > buf_end - buf || nal_size < 0)
goto fail; goto fail;
if (unit_type == 7) if (unit_type == 7)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment