Commit e146ad95 authored by Michael Niedermayer's avatar Michael Niedermayer

mlp_parser: Fix infinite loop with 0 bytes_left.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent bace181b
...@@ -263,6 +263,9 @@ static int mlp_parse(AVCodecParserContext *s, ...@@ -263,6 +263,9 @@ static int mlp_parse(AVCodecParserContext *s,
mp->bytes_left = ((mp->pc.index > 0 ? mp->pc.buffer[0] : buf[0]) << 8) mp->bytes_left = ((mp->pc.index > 0 ? mp->pc.buffer[0] : buf[0]) << 8)
| (mp->pc.index > 1 ? mp->pc.buffer[1] : buf[1-mp->pc.index]); | (mp->pc.index > 1 ? mp->pc.buffer[1] : buf[1-mp->pc.index]);
mp->bytes_left = (mp->bytes_left & 0xfff) * 2; mp->bytes_left = (mp->bytes_left & 0xfff) * 2;
if (mp->bytes_left <= 0) { // prevent infinite loop
goto lost_sync;
}
mp->bytes_left -= mp->pc.index; mp->bytes_left -= mp->pc.index;
} }
......
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