aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/charset.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp
index 4a5cee9c4a..8ef53243b5 100644
--- a/scumm/charset.cpp
+++ b/scumm/charset.cpp
@@ -1343,11 +1343,13 @@ void CharsetRendererClassic::printChar(int chr) {
}
// Blit the image data
- do {
- memcpy(back, dst, w);
- back += backSurface.pitch;
- dst += dstSurface.pitch;
- } while (--h);
+ if (w > 0) {
+ while (h-- > 0) {
+ memcpy(back, dst, w);
+ back += backSurface.pitch;
+ dst += dstSurface.pitch;
+ }
+ }
}
_left += origWidth;