Commit 03c4a629 authored by berak's avatar berak

expanded the CV_Assert in pyrdown_ to check for empty mats

parent c4e1edbb
...@@ -203,7 +203,8 @@ pyrDown_( const Mat& _src, Mat& _dst, int borderType ) ...@@ -203,7 +203,8 @@ pyrDown_( const Mat& _src, Mat& _dst, int borderType )
CastOp castOp; CastOp castOp;
VecOp vecOp; VecOp vecOp;
CV_Assert( std::abs(dsize.width*2 - ssize.width) <= 2 && CV_Assert( ssize.width > 0 && ssize.height > 0 &&
std::abs(dsize.width*2 - ssize.width) <= 2 &&
std::abs(dsize.height*2 - ssize.height) <= 2 ); std::abs(dsize.height*2 - ssize.height) <= 2 );
int k, x, sy0 = -PD_SZ/2, sy = sy0, width0 = std::min((ssize.width-PD_SZ/2-1)/2 + 1, dsize.width); int k, x, sy0 = -PD_SZ/2, sy = sy0, width0 = std::min((ssize.width-PD_SZ/2-1)/2 + 1, dsize.width);
......
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