Commit fba0ac28 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dpx_parser: Allow frame size to be too small

Fixes Ticket3402
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8df5d9aa
...@@ -68,7 +68,6 @@ static int dpx_parse(AVCodecParserContext *s, AVCodecContext *avctx, ...@@ -68,7 +68,6 @@ static int dpx_parse(AVCodecParserContext *s, AVCodecContext *avctx,
d->remaining_size -= i; d->remaining_size -= i;
if (d->remaining_size) if (d->remaining_size)
goto flush; goto flush;
next = i;
} }
} }
...@@ -84,10 +83,17 @@ static int dpx_parse(AVCodecParserContext *s, AVCodecContext *avctx, ...@@ -84,10 +83,17 @@ static int dpx_parse(AVCodecParserContext *s, AVCodecContext *avctx,
if (d->fsize > buf_size - i + 19) if (d->fsize > buf_size - i + 19)
d->remaining_size = d->fsize - buf_size + i - 19; d->remaining_size = d->fsize - buf_size + i - 19;
else else
next = d->fsize + i - 19; i += d->fsize - 19;
break;
} else if (d->index > 17) {
if (d->pc.state == MKBETAG('S','D','P','X') ||
d->pc.state == MKTAG('S','D','P','X')) {
next = i - 4;
break; break;
} }
} }
}
flush: flush:
if (ff_combine_frame(&d->pc, next, &buf, &buf_size) < 0) if (ff_combine_frame(&d->pc, next, &buf, &buf_size) < 0)
......
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