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:
11ed55d
)
fixed crash in cvDrawContours when abs(maxLevel) is too big
author
Vadim Pisarevsky
<no@email>
Sat, 4 Dec 2010 15:31:42 +0000
(15:31 +0000)
committer
Vadim Pisarevsky
<no@email>
Sat, 4 Dec 2010 15:31:42 +0000
(15:31 +0000)
modules/core/src/drawing.cpp
patch
|
blob
|
history
diff --git
a/modules/core/src/drawing.cpp
b/modules/core/src/drawing.cpp
index c8fbc3c53334ed6d56cae2c684a8cd508c702e0e..56cac1515ab9203ae42b6e4d6290207fa15a9f99 100644
(file)
--- a/
modules/core/src/drawing.cpp
+++ b/
modules/core/src/drawing.cpp
@@
-2033,12
+2033,14
@@
cvDrawContours( void* _img, CvSeq* contour,
scalarToRawData( externalColor, ext_buf, img.type(), 0 );
scalarToRawData( holeColor, hole_buf, img.type(), 0 );
+ maxLevel = MAX(maxLevel, INT_MIN-2);
+ maxLevel = MIN(maxLevel, INT_MAX-1);
+
if( maxLevel < 0 )
{
h_next = contour->h_next;
contour->h_next = 0;
maxLevel = -maxLevel+1;
- maxLevel -= maxLevel < 0;
}
cvInitTreeNodeIterator( &iterator, contour, maxLevel );