[FFmpeg-cvslog] avcodec/bmp_parser: Check fsize

Michael Niedermayer git at videolan.org
Mon Jun 6 14:54:17 CEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Jun  6 14:32:48 2016 +0200| [43a4276c6964a2ec57e08c3c622bb94d35c0441f] | committer: Michael Niedermayer

avcodec/bmp_parser: Check fsize

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

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

 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