Commit 1e2788e8 authored by reimar's avatar reimar

Fix possible crashes in mlp parser, it tries to go back 7 bytes after

finding the 4-byte signature.
Add a check that ignores the signature if we do not have enough previous
data to go back at least 7 bytes.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21487 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1a2175b0
......@@ -176,7 +176,9 @@ static int mlp_parse(AVCodecParserContext *s,
for (i = 0; i < buf_size; i++) {
mp->pc.state = (mp->pc.state << 8) | buf[i];
if ((mp->pc.state & 0xfffffffe) == 0xf8726fba) {
if ((mp->pc.state & 0xfffffffe) == 0xf8726fba &&
// ignore if we do not have the data for the start of header
mp->pc.index + i >= 7) {
mp->in_sync = 1;
mp->bytes_left = 0;
break;
......
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