summaryrefslogtreecommitdiffstats
path: root/src/concurrent/qtconcurrentmedian.h
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-02-11 12:31:04 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-02-20 20:19:36 +0000
commit8dbd245979dac890c9317a27067a43205314a4f0 (patch)
tree356bdd4f68f1bd7ea96533cd7aa9f13728635486 /src/concurrent/qtconcurrentmedian.h
parenta245c312b87a87ed6707e255de627aa8d1e0be7b (diff)
QtConcurrent::MedianDouble: do not access uninitialzed values
Properly initialize MedianDouble::values in ctor. This fixes the following valgrind warnings in the unit test: Conditional jump or move depends on uninitialised value(s) at 0x40771E4: addValue (qtconcurrentmedian.h:161) by 0x40771E4: QtConcurrent::BlockSizeManagerV2::timeAfterUser() (qtconcurrentiteratekernel.cpp:195) Change-Id: I8c8e297a52caca38cd6191ae2653f2765d387077 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/concurrent/qtconcurrentmedian.h')
-rw-r--r--src/concurrent/qtconcurrentmedian.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/concurrent/qtconcurrentmedian.h b/src/concurrent/qtconcurrentmedian.h
index 87e6b2935d..864b2d33d5 100644
--- a/src/concurrent/qtconcurrentmedian.h
+++ b/src/concurrent/qtconcurrentmedian.h
@@ -135,6 +135,7 @@ public:
MedianDouble()
: currentMedian(), currentIndex(0), valid(false), dirty(true)
{
+ std::fill_n(values, static_cast<int>(BufferSize), 0.0);
}
void reset()