From f38b271d74c9f78c8dd538e153bad57243dca98b Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 10 Oct 2017 15:44:27 +0200 Subject: [PATCH] fix heap-buffer-overflow in wavelet, Detected by AddressSanitizer. #4127 --- rtengine/ipwavelet.cc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index a5c9b6d7a..dd2a32e10 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -669,12 +669,12 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int #pragma omp parallel num_threads(numthreads) #endif { - float *mean = new float [9]; - float *meanN = new float [9]; - float *sigma = new float [9]; - float *sigmaN = new float [9]; - float *MaxP = new float [9]; - float *MaxN = new float [9]; + float mean[10]; + float meanN[10]; + float sigma[10]; + float sigmaN[10]; + float MaxP[10]; + float MaxN[10]; float** varhue = new float*[tileheight]; @@ -1247,12 +1247,6 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int delete [] varchro; - delete [] mean; - delete [] meanN; - delete [] sigma; - delete [] sigmaN; - delete [] MaxP; - delete [] MaxN; } #ifdef _RT_NESTED_OPENMP omp_set_nested(oldNested);