diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-09-13 17:46:18 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-09-13 17:46:18 +0200 |
commit | ceb2fe027fec2bf8f1847d8a9676630583031e65 (patch) | |
tree | 0e4c432852b875b3649215369ffe2ace0af30cf3 | |
parent | 3c6d824b80022cc7c098658880b4b5c5778dc965 (diff) | |
download | ffmpeg-ceb2fe027fec2bf8f1847d8a9676630583031e65.tar.gz |
avcodec/bmp_parser: delay frame end detection to the next header or EOF
Fixes Ticket3687
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/bmp_parser.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/bmp_parser.c b/libavcodec/bmp_parser.c index b5845ed867..c9493dc32d 100644 --- a/libavcodec/bmp_parser.c +++ b/libavcodec/bmp_parser.c @@ -62,11 +62,13 @@ restart: bpc->pc.frame_start_found = 0; continue; } - if (bpc->fsize <= ihsize + 14) - bpc->fsize = INT_MAX/2; bpc->pc.frame_start_found++; bpc->remaining_size = bpc->fsize + i - 17; - goto restart; + + if (bpc->pc.index + i > 17) { + next = i - 17; + } else + goto restart; } else if (bpc->pc.frame_start_found) bpc->pc.frame_start_found++; } @@ -77,7 +79,9 @@ restart: bpc->remaining_size -= i; if (bpc->remaining_size) goto flush; - next = i; + + bpc->pc.frame_start_found = 0; + goto restart; } } |