diff options
author | Paul Gilbert | 2014-11-01 13:55:52 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-12-12 22:18:58 -0500 |
commit | 386aae3ffa60c9ef44181cb730ab947544b2e761 (patch) | |
tree | f105ab2282ea176194e2ffc9b559914b53cad722 /engines | |
parent | fb6d9230dc24d68b888ed4cefbf99bbf2fb60e3d (diff) | |
download | scummvm-rg350-386aae3ffa60c9ef44181cb730ab947544b2e761.tar.gz scummvm-rg350-386aae3ffa60c9ef44181cb730ab947544b2e761.tar.bz2 scummvm-rg350-386aae3ffa60c9ef44181cb730ab947544b2e761.zip |
ACCESS: Workaround for background column rendering bug in original
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/room.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/access/room.cpp b/engines/access/room.cpp index 2c597609e1..181dcd6c5b 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -309,7 +309,10 @@ void Room::buildColumn(int playX, int screenX) { const byte *pSrc = _playField + _vm->_screen->_scrollRow * _playFieldWidth + playX; - for (int y = 0; y <= _vm->_screen->_vWindowHeight; ++y) { + // WORKAROUND: Original's use of '+ 1' would frequently cause memory overruns + int h = MIN(_vm->_screen->_vWindowHeight + 1, _playFieldHeight); + + for (int y = 0; y < h; ++y) { byte *pTile = _tile + (*pSrc << 8); byte *pDest = (byte *)_vm->_buffer1.getBasePtr(screenX, y * TILE_HEIGHT); |