diff --git a/src/rlgl.h b/src/rlgl.h index ed5e50fb1..8c529a4e0 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -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) {