aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2004-08-15 16:23:18 +0000
committerMax Horn2004-08-15 16:23:18 +0000
commitb48c56875fcec1d6177279994f016850c53f8c78 (patch)
tree2357f3cc8c53edccf175b863a3a2b7dbb567d359 /scumm
parent784a786969980d66a8546af761a3adccabff5f65 (diff)
downloadscummvm-rg350-b48c56875fcec1d6177279994f016850c53f8c78.tar.gz
scummvm-rg350-b48c56875fcec1d6177279994f016850c53f8c78.tar.bz2
scummvm-rg350-b48c56875fcec1d6177279994f016850c53f8c78.zip
Fix potential OOB access
svn-id: r14630
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index d4171f386e..3199f5ec5b 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -643,7 +643,7 @@ void ScummEngine::restoreBG(Common::Rect rect, byte backColor) {
if (vs->hasTwoBuffers && _currentRoom != 0 && isLightOn()) {
blit(screenBuf, vs->pitch, vs->getBackPixels(rect.left, rect.top), vs->pitch, width, height);
if (vs->number == kMainVirtScreen && _charset->_hasMask) {
- byte *mask = (byte *)gdi._textSurface.pixels + gdi._textSurface.pitch * rect.top + rect.left;
+ byte *mask = (byte *)gdi._textSurface.pixels + gdi._textSurface.pitch * (rect.top - _screenTop) + rect.left;
fill(mask, gdi._textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width, height);
}
} else {