From c46521ad65bb7c8d5c55a9f696b6bd52acdd17b8 Mon Sep 17 00:00:00 2001 From: blendin Date: Sat, 21 Oct 2017 12:12:53 -0700 Subject: [PATCH] Fix out of bounds write --- modules/highgui/src/grfmt_bmp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/highgui/src/grfmt_bmp.cpp b/modules/highgui/src/grfmt_bmp.cpp index bf9bf758a4..d17667eff6 100644 --- a/modules/highgui/src/grfmt_bmp.cpp +++ b/modules/highgui/src/grfmt_bmp.cpp @@ -115,7 +115,7 @@ bool BmpDecoder::readHeader() if( m_bpp <= 8 ) { - CV_Assert(clrused <= 256); + CV_Assert(clrused >= 0 && clrused <= 256); memset(m_palette, 0, sizeof(m_palette)); m_strm.getBytes(m_palette, (clrused == 0? 1<