diff options
author | Sven Hesse | 2011-01-27 20:50:43 +0000 |
---|---|---|
committer | Sven Hesse | 2011-01-27 20:50:43 +0000 |
commit | 261a640a9386f2504149b48b7518e3b501df6f47 (patch) | |
tree | 43cffb145f834b639b2a4d3b7449f228b84efcd4 | |
parent | 6513748c460424bef3b2f95dba1648a6be39f72e (diff) | |
download | scummvm-rg350-261a640a9386f2504149b48b7518e3b501df6f47.tar.gz scummvm-rg350-261a640a9386f2504149b48b7518e3b501df6f47.tar.bz2 scummvm-rg350-261a640a9386f2504149b48b7518e3b501df6f47.zip |
GOB: Stop drawing a letter on surface boundaries
svn-id: r55574
-rw-r--r-- | engines/gob/video.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index 84aca62cc5..28550b2f56 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -110,17 +110,20 @@ void Font::drawLetter(Surface &surf, uint8 c, uint16 x, uint16 y, nWidth >>= 3; - for (int i = 0; i < _itemHeight; i++) { + for (int i = 0; (i < _itemHeight) && dst.isValid(); i++) { int width = _itemWidth; for (int k = 0; k < nWidth; k++) { data = *src++; for (int j = 0; j < MIN(8, width); j++) { - if (data & 0x80) - dst.set(color1); - else if (!transp) - dst.set(color2); + + if (dst.isValid()) { + if (data & 0x80) + dst.set(color1); + else if (!transp) + dst.set(color2); + } dst++; data <<= 1; |