diff options
author | Martin Kiewitz | 2014-06-03 22:42:56 +0200 |
---|---|---|
committer | Martin Kiewitz | 2014-06-03 22:42:56 +0200 |
commit | cebb3e340a5c7ab74e7ea1a34a39c7dab0040022 (patch) | |
tree | 0376222d5fa9f1efedc71680b4eee3f670fa226d /engines/sci/graphics | |
parent | 4e27db88410b2a8c0366a09a2b9abcfdda913069 (diff) | |
download | scummvm-rg350-cebb3e340a5c7ab74e7ea1a34a39c7dab0040022.tar.gz scummvm-rg350-cebb3e340a5c7ab74e7ea1a34a39c7dab0040022.tar.bz2 scummvm-rg350-cebb3e340a5c7ab74e7ea1a34a39c7dab0040022.zip |
SCI32: fix crash during gabriel knight intro
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/paint32.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index f94c65c76b..7d106b5b02 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -43,8 +43,12 @@ GfxPaint32::~GfxPaint32() { void GfxPaint32::fillRect(Common::Rect rect, byte color) { int16 y, x; - for (y = rect.top; y < rect.bottom; y++) { - for (x = rect.left; x < rect.right; x++) { + Common::Rect clipRect = rect; + + clipRect.clip(_screen->getWidth(), _screen->getHeight()); + + for (y = clipRect.top; y < clipRect.bottom; y++) { + for (x = clipRect.left; x < clipRect.right; x++) { _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, color, 0, 0); } } |