Skip to content
Snippets Groups Projects
Commit 51ac3f43 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec/mlp_parser: Check if synccode is within buffer

Fixes: undefined shift
Fixes: 9216/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-6281404575907840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg


Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 7dd836a3
No related branches found
No related tags found
No related merge requests found
...@@ -320,7 +320,7 @@ static int mlp_parse(AVCodecParserContext *s, ...@@ -320,7 +320,7 @@ static int mlp_parse(AVCodecParserContext *s,
mp->bytes_left = 0; mp->bytes_left = 0;
} }
sync_present = (AV_RB32(buf + 4) & 0xfffffffe) == 0xf8726fba; sync_present = buf_size >= 8 && (AV_RB32(buf + 4) & 0xfffffffe) == 0xf8726fba;
if (!sync_present) { if (!sync_present) {
/* The first nibble of a frame is a parity check of the 4-byte /* The first nibble of a frame is a parity check of the 4-byte
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment