diff --git a/modules/imgproc/src/phasecorr.cpp b/modules/imgproc/src/phasecorr.cpp index 87e4d3080e..48d19fa3c1 100644 --- a/modules/imgproc/src/phasecorr.cpp +++ b/modules/imgproc/src/phasecorr.cpp @@ -167,6 +167,9 @@ static void divSpectrums( InputArray _srcA, InputArray _srcB, OutputArray _dst, _dst.create( srcA.rows, srcA.cols, type ); Mat dst = _dst.getMat(); + CV_Assert(dst.data != srcA.data); // non-inplace check + CV_Assert(dst.data != srcB.data); // non-inplace check + bool is_1d = (flags & DFT_ROWS) || (rows == 1 || (cols == 1 && srcA.isContinuous() && srcB.isContinuous() && dst.isContinuous()));