aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/cine/gfx.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index eac8d6d39a..57e58a7c1c 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -259,8 +259,8 @@ void gfxSpriteFunc2(byte *spritePtr, byte *spriteMskPtr, int16 width, int16 heig
if (width <= 0) {
return;
}
- for (j = 0; j < height; ++j) {
- for (i = 0; i < width; ++i) {
+ for (j = 0; j < MIN(maskHeight, height); ++j) {
+ for (i = 0; i < MIN(maskWidth, width); ++i) {
bufferMskPtr[i] |= maskPtr[i] ^ 1;
}
bufferMskPtr += spritePitch;