Commit d3350b50 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

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

parent c3caaf3b
......@@ -437,6 +437,9 @@ void FilterEngine::apply(const Mat& src, Mat& dst,
Rect srcRoi = _srcRoi;
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 &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment