diff --git a/modules/core/src/mean.cpp b/modules/core/src/mean.cpp index b488ee230a..aed5f76ac5 100644 --- a/modules/core/src/mean.cpp +++ b/modules/core/src/mean.cpp @@ -674,10 +674,23 @@ static bool ipp_meanStdDev(Mat& src, OutputArray _mean, OutputArray _sdv, Mat& m if (cn > 1) return false; #endif -#if IPP_VERSION_X100 < 201901 +#if IPP_VERSION_X100 >= 201900 && IPP_VERSION_X100 < 201901 // IPP_DISABLE: 32f C3C functions can read outside of allocated memory if (cn > 1 && src.depth() == CV_32F) return false; + + // SSE4.2 buffer overrun +#if defined(_WIN32) && !defined(_WIN64) + // IPPICV doesn't have AVX2 in 32-bit builds + // However cv::ipp::getIppTopFeatures() may return AVX2 value on AVX2 capable H/W + // details #12959 +#else + if (cv::ipp::getIppTopFeatures() == ippCPUID_SSE42) // Linux x64 + OPENCV_IPP=SSE42 is affected too +#endif + { + if (src.depth() == CV_32F && src.dims > 1 && src.size[src.dims - 1] == 6) + return false; + } #endif size_t total_size = src.total();