From dadc8342bb9ba9b95538a2e0a8369fbe4d7ae8e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jarkko=20P=C3=B6yry?= Date: Thu, 25 Sep 2014 16:27:06 -0700 Subject: [PATCH] Verify component count is in the legal range. Change-Id: I50a18f9c8a5d4aac8e9b246b751dceca343991cc --- modules/glshared/glsDrawTest.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/glshared/glsDrawTest.cpp b/modules/glshared/glsDrawTest.cpp index 64baf81..69e4f22 100644 --- a/modules/glshared/glsDrawTest.cpp +++ b/modules/glshared/glsDrawTest.cpp @@ -1655,6 +1655,8 @@ char* RandomArrayGenerator::generateBasicArray (int seed, int elementCount, int template char* RandomArrayGenerator::createBasicArray (int seed, int elementCount, int componentCount, int offset, int stride) { + DE_ASSERT(componentCount >= 1 && componentCount <= 4); + const GLType min = extractGLValue(GLValue::getMinValue(GLValueTypeTraits::Type)); const GLType max = extractGLValue(GLValue::getMaxValue(GLValueTypeTraits::Type)); @@ -1700,6 +1702,7 @@ char* RandomArrayGenerator::createBasicArray (int seed, int elementCount, int co char* RandomArrayGenerator::generatePackedArray (int seed, int elementCount, int componentCount, int offset, int stride) { + DE_ASSERT(componentCount == 4); DE_UNREF(componentCount); const deUint32 limit10 = (1 << 10); -- 2.7.4