mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-13 02:34:54 +00:00
avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
Fixes Ticket4778
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2bb54b82b5
)
This commit is contained in:
parent
1024bcab62
commit
8b158bf62c
@ -182,7 +182,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)
|
||||||
|
Loading…
Reference in New Issue
Block a user