The calculation of _MaxElement was wrong if the stride was larger than
elementSize, which lead to rejection of every DrawElements call which accessed
the maximum element if CheckArrayBounds was enabled.
*/
if (ctx->Array.ArrayBufferObj->Name)
array->_MaxElement = ((GLsizeiptrARB) ctx->Array.ArrayBufferObj->Size
- - (GLsizeiptrARB) array->Ptr) / array->StrideB;
+ - (GLsizeiptrARB) array->Ptr + array->StrideB
+ - elementSize) / array->StrideB;
else
#endif
array->_MaxElement = 2 * 1000 * 1000 * 1000; /* just a big number */