aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/graphics/plane32.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/sci/graphics/plane32.cpp b/engines/sci/graphics/plane32.cpp
index 175875c414..87ab43bb5c 100644
--- a/engines/sci/graphics/plane32.cpp
+++ b/engines/sci/graphics/plane32.cpp
@@ -595,8 +595,10 @@ void Plane::filterDownEraseRects(DrawList &drawList, RectList &eraseList, RectLi
Common::Rect outRects[4];
const Common::Rect &r2 = *higherEraseList[i];
int splitCount = splitRects(r2, r, outRects);
- while (splitCount--) {
- higherEraseList.add(outRects[splitCount]);
+ if (splitCount > 0) {
+ while (splitCount--) {
+ higherEraseList.add(outRects[splitCount]);
+ }
}
higherEraseList.erase_at(i);
}