RectangleTest::makeGradient in glcPackedPixelsTests does not
properly account for skip images. This commit prevents it
writing over the end of an array.
Affects:
KHR-GL33.packed_pixels.*
Components: OpenGL ES
VK-GL-CTS Issue: 3275
Change-Id: I9d8a47b59c000512926c3bfc85b6c6dc66eee213
const Type defaultValue = unpack(0.5f);
std::fill(data, data + dataToSkip, defaultValue);
- for (int k = 0; k < depth; k++)
+ for (int k = m_unpackProperties.skipImages; k < depth; k++)
{
for (int j = 0; j < rowCount; j++)
{
for (int i = 0; i < elementsInRow; i++)
{
+ DE_ASSERT(index < bufferSize);
int x = i / elementsInGroup;
if ((k == depth - 1) && (m_unpackProperties.skipRows <= j) &&
(j < m_unpackProperties.skipRows + GRADIENT_HEIGHT) && (m_unpackProperties.skipPixels <= x) &&