Zero initialize array in internal tests
authorMika Väinölä <mika.vainola@siru.fi>
Wed, 1 Dec 2021 10:24:52 +0000 (12:24 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 6 Jan 2022 22:40:33 +0000 (22:40 +0000)
This suppresses a -Wmaybe-uninitialized warning in GCC 11 release
builds.

Affects: dE-IT.delibs.decpp.block_buffer

Components: Framework

VK-GL-CTS issue: 3378

Change-Id: I2315b5cdeecb6e9a54dd419c88134f30a3335029

framework/delibs/decpp/deBlockBuffer.cpp

index 7e00594..e2f5322 100644 (file)
@@ -25,6 +25,7 @@
 #include "deRandom.hpp"
 #include "deThread.hpp"
 #include "deInt32.h"
+#include "deMemory.h"
 
 #include <vector>
 
@@ -239,6 +240,8 @@ public:
                deUint8 tmp[1024];
                Random  rnd(m_seed);
 
+               deMemset(tmp, 0, DE_LENGTH_OF_ARRAY(tmp));
+
                for (;;)
                {
                        int blockSize = rnd.getInt(1, DE_LENGTH_OF_ARRAY(tmp));