mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 11:10:21 +08:00
imgcodecs(bmp): make happy UBSAN with enum value range check
This commit is contained in:
parent
1c4a64f0a1
commit
d1c35e7b61
@ -102,7 +102,9 @@ bool BmpDecoder::readHeader()
|
||||
m_width = m_strm.getDWord();
|
||||
m_height = m_strm.getDWord();
|
||||
m_bpp = m_strm.getDWord() >> 16;
|
||||
m_rle_code = (BmpCompression)m_strm.getDWord();
|
||||
int m_rle_code_ = m_strm.getDWord();
|
||||
CV_Assert(m_rle_code_ >= 0 && m_rle_code_ <= BMP_BITFIELDS);
|
||||
m_rle_code = (BmpCompression)m_rle_code_;
|
||||
m_strm.skip(12);
|
||||
int clrused = m_strm.getDWord();
|
||||
m_strm.skip( size - 36 );
|
||||
|
Loading…
Reference in New Issue
Block a user