Fix out of bounds access in draw buffers indexed tests
Change-Id: I42449896c58a5b7276b5876c26333b09cd863cae
diff --git a/modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp b/modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp
index 58e0d1d..df481db 100644
--- a/modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp
+++ b/modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp
@@ -1339,7 +1339,7 @@
if (isES32)
return glu::mapGLInternalFormat(de::getArrayElement(glFormats, rng.getUint32() % DE_LENGTH_OF_ARRAY(glFormats)));
else
- return glu::mapGLInternalFormat(de::getArrayElement(glFormats, rng.getUint32() % DE_LENGTH_OF_ARRAY(glFormats) - 6));
+ return glu::mapGLInternalFormat(de::getArrayElement(glFormats, rng.getUint32() % (DE_LENGTH_OF_ARRAY(glFormats) - 6)));
}
void genRandomTest (de::Random& rng, BlendState& preCommon, BlendState& postCommon, vector<DrawBufferInfo>& drawBuffers, int maxDrawBufferCount, Context& context)