1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-03 14:32:16 +02:00

avcodec/bmp_parser: simplify

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-09-13 17:21:31 +02:00
parent b11d1889ef
commit 3c6d824b80

View File

@ -46,6 +46,7 @@ static int bmp_parse(AVCodecParserContext *s, AVCodecContext *avctx,
*poutbuf_size = 0; *poutbuf_size = 0;
restart:
if (bpc->pc.frame_start_found <= 2+4+4) { if (bpc->pc.frame_start_found <= 2+4+4) {
for (; i < buf_size; i++) { for (; i < buf_size; i++) {
state = (state << 8) | buf[i]; state = (state << 8) | buf[i];
@ -64,11 +65,8 @@ static int bmp_parse(AVCodecParserContext *s, AVCodecContext *avctx,
if (bpc->fsize <= ihsize + 14) if (bpc->fsize <= ihsize + 14)
bpc->fsize = INT_MAX/2; bpc->fsize = INT_MAX/2;
bpc->pc.frame_start_found++; bpc->pc.frame_start_found++;
if (bpc->fsize > buf_size - i + 17) bpc->remaining_size = bpc->fsize + i - 17;
bpc->remaining_size = bpc->fsize - buf_size + i - 17; goto restart;
else
next = bpc->fsize + i - 17;
break;
} else if (bpc->pc.frame_start_found) } else if (bpc->pc.frame_start_found)
bpc->pc.frame_start_found++; bpc->pc.frame_start_found++;
} }