[FFmpeg-cvslog] avcodec/bmp_parser: Check fsize

Michael Niedermayer git at videolan.org
Fri Aug 26 15:40:59 EEST 2016


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Mon Jun  6 14:32:48 2016 +0200| [003fa5c3e3c3d1027a886fb93cf9304a2b43b378] | committer: Michael Niedermayer

avcodec/bmp_parser: Check fsize

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 43a4276c6964a2ec57e08c3c622bb94d35c0441f)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=003fa5c3e3c3d1027a886fb93cf9304a2b43b378
---

 libavcodec/bmp_parser.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/bmp_parser.c b/libavcodec/bmp_parser.c
index d2a04ef..cd65f02 100644
--- a/libavcodec/bmp_parser.c
+++ b/libavcodec/bmp_parser.c
@@ -53,7 +53,8 @@ restart:
             if (bpc->pc.frame_start_found == 0) {
                 if ((state >> 48) == (('B' << 8) | 'M')) {
                     bpc->fsize = av_bswap32(state >> 16);
-                    bpc->pc.frame_start_found = 1;
+                    if (bpc->fsize > 17)
+                        bpc->pc.frame_start_found = 1;
                 }
             } else if (bpc->pc.frame_start_found == 2+4+4) {
 //                 unsigned hsize = av_bswap32(state>>32);



More information about the ffmpeg-cvslog mailing list