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>
This commit is contained in:
Christian Ehrlicher 2018-02-11 12:31:04 +01:00
parent a245c312b8
commit 8dbd245979

View File

@ -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()