Skip to content

Commit

Permalink
Merge pull request opencv#3135 from thorikawa:fix-arithmetic-exceptio…
Browse files Browse the repository at this point in the history
…n-with-ipp
  • Loading branch information
vpisarev committed Aug 21, 2014
2 parents 5afaa6b + cb0ab87 commit de2a8d3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/core/src/stat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ cv::Scalar cv::sum( InputArray _src )

#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
size_t total_size = src.total();
int rows = src.size[0], cols = (int)(total_size/rows);
int rows = src.size[0], cols = rows ? (int)(total_size/rows) : 0;
if( src.dims == 2 || (src.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
{
IppiSize sz = { cols, rows };
Expand Down Expand Up @@ -775,7 +775,7 @@ cv::Scalar cv::mean( InputArray _src, InputArray _mask )

#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
size_t total_size = src.total();
int rows = src.size[0], cols = (int)(total_size/rows);
int rows = src.size[0], cols = rows ? (int)(total_size/rows) : 0;
if( src.dims == 2 || (src.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
{
IppiSize sz = { cols, rows };
Expand Down Expand Up @@ -1037,7 +1037,7 @@ void cv::meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv, Input

#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
size_t total_size = src.total();
int rows = src.size[0], cols = (int)(total_size/rows);
int rows = src.size[0], cols = rows ? (int)(total_size/rows) : 0;
if( src.dims == 2 || (src.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
{
Ipp64f mean_temp[3];
Expand Down Expand Up @@ -1583,7 +1583,7 @@ void cv::minMaxIdx(InputArray _src, double* minVal,

#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
size_t total_size = src.total();
int rows = src.size[0], cols = (int)(total_size/rows);
int rows = src.size[0], cols = rows ? (int)(total_size/rows) : 0;
if( src.dims == 2 || (src.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
{
IppiSize sz = { cols * cn, rows };
Expand Down Expand Up @@ -2246,7 +2246,7 @@ double cv::norm( InputArray _src, int normType, InputArray _mask )

#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
size_t total_size = src.total();
int rows = src.size[0], cols = (int)(total_size/rows);
int rows = src.size[0], cols = rows ? (int)(total_size/rows) : 0;

if( (src.dims == 2 || (src.isContinuous() && mask.isContinuous()))
&& cols > 0 && (size_t)rows*cols == total_size
Expand Down Expand Up @@ -2607,7 +2607,7 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
CV_Assert( normType == NORM_INF || normType == NORM_L1 || normType == NORM_L2 || normType == NORM_L2SQR ||
((normType == NORM_HAMMING || normType == NORM_HAMMING2) && src1.type() == CV_8U) );
size_t total_size = src1.total();
int rows = src1.size[0], cols = (int)(total_size/rows);
int rows = src1.size[0], cols = rows ? (int)(total_size/rows) : 0;
if( (src1.dims == 2 || (src1.isContinuous() && src2.isContinuous() && mask.isContinuous()))
&& cols > 0 && (size_t)rows*cols == total_size
&& (normType == NORM_INF || normType == NORM_L1 ||
Expand Down Expand Up @@ -2703,7 +2703,7 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m

#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
size_t total_size = src1.total();
int rows = src1.size[0], cols = (int)(total_size/rows);
int rows = src1.size[0], cols = rows ? (int)(total_size/rows) : 0;
if( (src1.dims == 2 || (src1.isContinuous() && src2.isContinuous() && mask.isContinuous()))
&& cols > 0 && (size_t)rows*cols == total_size
&& (normType == NORM_INF || normType == NORM_L1 ||
Expand Down

0 comments on commit de2a8d3

Please sign in to comment.