From b8b7f155a5be52a0bb85a748fe69cac447928ccb Mon Sep 17 00:00:00 2001 From: Rostislav Vasilikhin Date: Mon, 5 Sep 2016 22:33:31 +0300 Subject: [PATCH] fixed random failures in Core_DFT.complex_output2 test (the case of input_mat.cols == 1) --- modules/core/src/dxt.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/core/src/dxt.cpp b/modules/core/src/dxt.cpp index 79cb31ceed..90eb392f58 100644 --- a/modules/core/src/dxt.cpp +++ b/modules/core/src/dxt.cpp @@ -1070,11 +1070,12 @@ RealDFT( const T* src, T* dst, int n, int nf, int* factors, const int* itab, } } - if( complex_output && (n & 1) == 0 ) + if (complex_output && ((n & 1) == 0 || n == 1)) { dst[-1] = dst[0]; dst[0] = 0; - dst[n] = 0; + if (n > 1) + dst[n] = 0; } }