aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2004-09-29 00:04:38 +0000
committerMax Horn2004-09-29 00:04:38 +0000
commitf2f27634c2718f666299cc9001e1cbdb908f9c4d (patch)
treeae883d8ed363168d58b693e7749e9538de2ed4ee /scumm
parentead49832a9d2b544b1e7cb6ea82b757926af9e94 (diff)
downloadscummvm-rg350-f2f27634c2718f666299cc9001e1cbdb908f9c4d.tar.gz
scummvm-rg350-f2f27634c2718f666299cc9001e1cbdb908f9c4d.tar.bz2
scummvm-rg350-f2f27634c2718f666299cc9001e1cbdb908f9c4d.zip
Check for negative width/height
svn-id: r15340
Diffstat (limited to 'scumm')
-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;