diff --git a/desmume/src/matrix.cpp b/desmume/src/matrix.cpp index d9c3bd780..b298cb4fe 100644 --- a/desmume/src/matrix.cpp +++ b/desmume/src/matrix.cpp @@ -195,7 +195,7 @@ void MatrixStackSetStackPosition (MatrixStack *stack, int pos) if (stack->position < 0) stack->position = 0; else if (stack->position > stack->size) - stack->position = stack->size; + stack->position = stack->size+1; } void MatrixStackPushMatrix (MatrixStack *stack, const float *ptr)