X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmlp_parser.c;h=eb3435b6cbafb35d094dd09fd8499cdbed1ba7f1;hb=c7488f746154b5dcd70f8a3bef9a9fa5c42ac595;hp=185bd4d667f66284aba7a69ef22a2a0c27901a33;hpb=a7109b82c4ab86a7ae75ad34245af918f1a26b95;p=ffmpeg diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c index 185bd4d667f..eb3435b6cba 100644 --- a/libavcodec/mlp_parser.c +++ b/libavcodec/mlp_parser.c @@ -320,7 +320,7 @@ static int mlp_parse(AVCodecParserContext *s, 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) { /* The first nibble of a frame is a parity check of the 4-byte