From 0ee8634b2f07a7e2dec541e2e20ae5996e877275 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Tue, 5 May 2015 20:31:30 +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 3d3d589..e3fd0e4 100644 --- a/modules/core/src/dxt.cpp +++ b/modules/core/src/dxt.cpp @@ -1089,11 +1089,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; } } -- 2.7.4