diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-09-13 17:21:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-09-13 17:21:31 +0200 |
commit | 3c6d824b80022cc7c098658880b4b5c5778dc965 (patch) | |
tree | 23c0ad67d2b623d64136f6b1b9370e787f3b6c8d /libavcodec/bmp_parser.c | |
parent | b11d1889ef607a51dd93dae86e661f0b153b141c (diff) | |
download | ffmpeg-3c6d824b80022cc7c098658880b4b5c5778dc965.tar.gz |
avcodec/bmp_parser: simplify
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/bmp_parser.c')
-rw-r--r-- | libavcodec/bmp_parser.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/bmp_parser.c b/libavcodec/bmp_parser.c index 25fdd27aaa..b5845ed867 100644 --- a/libavcodec/bmp_parser.c +++ b/libavcodec/bmp_parser.c @@ -46,6 +46,7 @@ static int bmp_parse(AVCodecParserContext *s, AVCodecContext *avctx, *poutbuf_size = 0; +restart: if (bpc->pc.frame_start_found <= 2+4+4) { for (; i < buf_size; i++) { state = (state << 8) | buf[i]; @@ -64,11 +65,8 @@ static int bmp_parse(AVCodecParserContext *s, AVCodecContext *avctx, if (bpc->fsize <= ihsize + 14) bpc->fsize = INT_MAX/2; bpc->pc.frame_start_found++; - if (bpc->fsize > buf_size - i + 17) - bpc->remaining_size = bpc->fsize - buf_size + i - 17; - else - next = bpc->fsize + i - 17; - break; + bpc->remaining_size = bpc->fsize + i - 17; + goto restart; } else if (bpc->pc.frame_start_found) bpc->pc.frame_start_found++; } |