From 08a5fe3661b4cab8758e289927cfdc96c10458da 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/imgcodecs/src/grfmt_bmp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgcodecs/src/grfmt_bmp.cpp b/modules/imgcodecs/src/grfmt_bmp.cpp index 3817c41452..d20503fdae 100644 --- a/modules/imgcodecs/src/grfmt_bmp.cpp +++ b/modules/imgcodecs/src/grfmt_bmp.cpp @@ -118,7 +118,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<