projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9ae86a9
)
Fix out of bounds write
author
blendin
<btiszka@gmail.com>
Sat, 21 Oct 2017 19:12:53 +0000
(12:12 -0700)
committer
blendin
<btiszka@gmail.com>
Sat, 21 Oct 2017 19:12:53 +0000
(12:12 -0700)
modules/imgcodecs/src/grfmt_bmp.cpp
patch
|
blob
|
history
diff --git
a/modules/imgcodecs/src/grfmt_bmp.cpp
b/modules/imgcodecs/src/grfmt_bmp.cpp
index
3817c41
..
d20503f
100644
(file)
--- 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<<m_bpp : clrused)*4 );
iscolor = IsColorPalette( m_palette, m_bpp );