From 2d5ccc7b3efd095ab106f0ce1fd30925fffc4551 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 3 Dec 2018 13:07:58 +0300 Subject: [PATCH] imgproc(resize): update checks (static analyzers) --- modules/imgproc/src/resize.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/imgproc/src/resize.cpp b/modules/imgproc/src/resize.cpp index 123ad4fd72..f182b77d0c 100644 --- a/modules/imgproc/src/resize.cpp +++ b/modules/imgproc/src/resize.cpp @@ -3782,9 +3782,9 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize, Size ssize = _src.size(); CV_Assert( !ssize.empty() ); - CV_Assert( !dsize.empty() || (inv_scale_x > 0 && inv_scale_y > 0) ); if( dsize.empty() ) { + CV_Assert(inv_scale_x > 0); CV_Assert(inv_scale_y > 0); dsize = Size(saturate_cast(ssize.width*inv_scale_x), saturate_cast(ssize.height*inv_scale_y)); CV_Assert( !dsize.empty() ); @@ -3793,6 +3793,7 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize, { inv_scale_x = (double)dsize.width/ssize.width; inv_scale_y = (double)dsize.height/ssize.height; + CV_Assert(inv_scale_x > 0); CV_Assert(inv_scale_y > 0); } if (interpolation == INTER_LINEAR_EXACT && (_src.depth() == CV_32F || _src.depth() == CV_64F))