[FFmpeg-cvslog] avcodec/bmp_parser: Check fsize

Michael Niedermayer git at videolan.org
Sat Aug 13 16:29:59 EEST 2016


ffmpeg | branch: release/3.0 | Michael Niedermayer <michael at niedermayer.cc> | Mon Jun  6 14:32:48 2016 +0200| [603fd4f771433bdddce2836dffca78c724d76dea] | 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=603fd4f771433bdddce2836dffca78c724d76dea
---

 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