Commit c4ec46c1 authored by Alexander Alekhin's avatar Alexander Alekhin Committed by Alexander Alekhin

imgcodecs(sunras): avoid undefined shift

backporting of commit: f2803aba
parent 69ff7a76
......@@ -90,7 +90,7 @@ bool SunRasterDecoder::readHeader()
m_width = m_strm.getDWord();
m_height = m_strm.getDWord();
m_bpp = m_strm.getDWord();
int palSize = 3*(1 << m_bpp);
int palSize = (m_bpp > 0 && m_bpp <= 8) ? (3*(1 << m_bpp)) : 0;
m_strm.skip( 4 );
m_encoding = (SunRasType)m_strm.getDWord();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment