Merge pull request #9915 from alalek:backport_9903

(2.4) Backport #9903: Fix out of bounds write
pull/9974/head
Alexander Alekhin 7 years ago committed by GitHub
commit e15a56d142
  1. 2
      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<<m_bpp : clrused)*4 );
iscolor = IsColorPalette( m_palette, m_bpp );

Loading…
Cancel
Save