[rlgl] Fix matrix stack overflow in rlPushMatrix()
The RL_MAX_MATRIX_STACK_SIZE check logged an error but did not return, so RLGL.State.stack[stackCounter] = *currentMatrix still executed when the stack was full -- writing one element past stack[RL_MAX_MATRIX_STACK_SIZE] and corrupting the adjacent RLGL.State members (stackCounter, etc.). rlPopMatrix() already guards the symmetric underflow case; add the missing early return.
This commit is contained in:
parent
962bbfc6bf
commit
5cfac55e34
|
|
@ -1237,7 +1237,11 @@ void rlMatrixMode(int mode)
|
|||
// Push the current matrix into RLGL.State.stack
|
||||
void rlPushMatrix(void)
|
||||
{
|
||||
if (RLGL.State.stackCounter >= RL_MAX_MATRIX_STACK_SIZE) TRACELOG(RL_LOG_ERROR, "RLGL: Matrix stack overflow (RL_MAX_MATRIX_STACK_SIZE)");
|
||||
if (RLGL.State.stackCounter >= RL_MAX_MATRIX_STACK_SIZE)
|
||||
{
|
||||
TRACELOG(RL_LOG_ERROR, "RLGL: Matrix stack overflow (RL_MAX_MATRIX_STACK_SIZE)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (RLGL.State.currentMatrixMode == RL_MODELVIEW)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user