From 0202e527476daceec544e63068742f70d1dfe934 Mon Sep 17 00:00:00 2001 From: blendin Date: Tue, 26 Sep 2017 23:04:01 -0700 Subject: [PATCH] Fix out of bounds write --- modules/highgui/src/grfmt_bmp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/highgui/src/grfmt_bmp.cpp b/modules/highgui/src/grfmt_bmp.cpp index 4e12882f50..de60ca6f61 100644 --- a/modules/highgui/src/grfmt_bmp.cpp +++ b/modules/highgui/src/grfmt_bmp.cpp @@ -367,6 +367,9 @@ decode_rle4_bad: ; gray_palette[code] ); line_end_flag = y - prev_y; + + if( y >= m_height ) + break; } else if( code > 2 ) // absolute mode {