avoid infinite loops when 0-area image is filtered (ticket #1295)

This commit is contained in:
Vadim Pisarevsky 2011-08-11 13:12:59 +00:00
parent c3caaf3b88
commit d3350b50aa

View File

@ -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 );