diff --git a/modules/imgproc/src/resize.cpp b/modules/imgproc/src/resize.cpp index 211642c48d95ea46e8363cc02990a65dbcb33134..0d57e1a933ac15e8c6a368a08d807572650a4ff0 100644 --- a/modules/imgproc/src/resize.cpp +++ b/modules/imgproc/src/resize.cpp @@ -3672,7 +3672,7 @@ void resize(int src_type, { CV_INSTRUMENT_REGION() - CV_Assert((dst_width * dst_height > 0) || (inv_scale_x > 0 && inv_scale_y > 0)); + CV_Assert((dst_width > 0 && dst_height > 0) || (inv_scale_x > 0 && inv_scale_y > 0)); if (inv_scale_x < DBL_EPSILON || inv_scale_y < DBL_EPSILON) { inv_scale_x = static_cast(dst_width) / src_width; @@ -3684,7 +3684,7 @@ void resize(int src_type, int depth = CV_MAT_DEPTH(src_type), cn = CV_MAT_CN(src_type); Size dsize = Size(saturate_cast(src_width*inv_scale_x), saturate_cast(src_height*inv_scale_y)); - CV_Assert( dsize.area() > 0 ); + CV_Assert( !dsize.empty() ); CV_IPP_RUN_FAST(ipp_resize(src_data, src_step, src_width, src_height, dst_data, dst_step, dsize.width, dsize.height, inv_scale_x, inv_scale_y, depth, cn, interpolation)) @@ -4041,13 +4041,13 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize, Size ssize = _src.size(); - CV_Assert( ssize.width > 0 && ssize.height > 0 ); - CV_Assert( dsize.area() > 0 || (inv_scale_x > 0 && inv_scale_y > 0) ); + CV_Assert( !ssize.empty() ); + CV_Assert( !dsize.empty() || (inv_scale_x > 0 && inv_scale_y > 0) ); if( dsize.area() == 0 ) { dsize = Size(saturate_cast(ssize.width*inv_scale_x), saturate_cast(ssize.height*inv_scale_y)); - CV_Assert( dsize.area() > 0 ); + CV_Assert( !dsize.empty() ); } else {