avoid infinite loops when 0-area image is filtered (ticket #1295)
This commit is contained in:
parent
c3caaf3b88
commit
d3350b50aa
@ -438,6 +438,9 @@ void FilterEngine::apply(const Mat& src, Mat& dst,
|
||||
if( srcRoi == Rect(0,0,-1,-1) )
|
||||
srcRoi = Rect(0,0,src.cols,src.rows);
|
||||
|
||||
if( srcRoi.area() == 0 )
|
||||
return;
|
||||
|
||||
CV_Assert( dstOfs.x >= 0 && dstOfs.y >= 0 &&
|
||||
dstOfs.x + srcRoi.width <= dst.cols &&
|
||||
dstOfs.y + srcRoi.height <= dst.rows );
|
||||
|
Loading…
x
Reference in New Issue
Block a user