From: Mika Isojärvi Date: Mon, 14 Mar 2016 16:21:30 +0000 (-0700) Subject: Fix out of bounds access in draw buffers indexed tests X-Git-Tag: upstream/0.1.0~438^2~369 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97fbad3f20ef38fd35c6858f72eb5d5071682d61;p=platform%2Fupstream%2FVK-GL-CTS.git 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 @@ 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)