Skip to content

Commit d4a96b6

Browse files
committed
Merge pull request opencv#14234 from alalek:backport_14203
2 parents 69ff7a7 + c4ec46c commit d4a96b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/imgcodecs/src/grfmt_sunras.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ bool SunRasterDecoder::readHeader()
9090
m_width = m_strm.getDWord();
9191
m_height = m_strm.getDWord();
9292
m_bpp = m_strm.getDWord();
93-
int palSize = 3*(1 << m_bpp);
93+
int palSize = (m_bpp > 0 && m_bpp <= 8) ? (3*(1 << m_bpp)) : 0;
9494

9595
m_strm.skip( 4 );
9696
m_encoding = (SunRasType)m_strm.getDWord();

0 commit comments

Comments
 (0)