Fix signed integer overflow in vertex array tests
authorAri Suonpaa <ari.suonpaa@siru.fi>
Wed, 1 Dec 2021 07:27:16 +0000 (09:27 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 2 Dec 2021 20:58:48 +0000 (20:58 +0000)
commit11ccf7377289442d541706528daa11bd85c524b0
tree3001a828db49fabac32e2e7ab14d9f5c31d3408e
parenteb1e8d0b6195b49520097e25065b3806f8a492dd
Fix signed integer overflow in vertex array tests

Random quad calculation in some of the vertex array tests were
calculating ranges for allowed quad sizes using signed integers,
and there was a chance for an overflow, which is undefined behavior.

Now the quad calculation randomizes only coordinates instead of
coordinates and the quad size. This lets us avoid the calculation
of the range.

Some bug fixes to the quad randomization code were also added.

VK-GL-CTS Issue: 3357

Affects:

dEQP-GLES3.functional.vertex_arrays.*

Components: OpenGL ES
Change-Id: I651ac6cef94e15d3fc0bc322ea8d65cbd96a4c2d
modules/glshared/glsVertexArrayTests.cpp