From 97fbad3f20ef38fd35c6858f72eb5d5071682d61 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mika=20Isoj=C3=A4rvi?= Date: Mon, 14 Mar 2016 09:21:30 -0700 Subject: [PATCH] Fix out of bounds access in draw buffers indexed tests Change-Id: I42449896c58a5b7276b5876c26333b09cd863cae --- modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ TextureFormat getRandomFormat (de::Random& rng, Context& context) 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& drawBuffers, int maxDrawBufferCount, Context& context) -- 2.7.4