diff options
author | Travis Howell | 2006-01-06 01:46:02 +0000 |
---|---|---|
committer | Travis Howell | 2006-01-06 01:46:02 +0000 |
commit | 53b7c6167653468b73c22b70871ede4da2eb7602 (patch) | |
tree | 9d5b9fdbad212cf58d5ec9bb83dbb593bfd8e813 /scumm | |
parent | 2ff05b9b4e6e9253801604db0320e2d514b690ba (diff) | |
download | scummvm-rg350-53b7c6167653468b73c22b70871ede4da2eb7602.tar.gz scummvm-rg350-53b7c6167653468b73c22b70871ede4da2eb7602.tar.bz2 scummvm-rg350-53b7c6167653468b73c22b70871ede4da2eb7602.zip |
Correct bounds checking for akos codec 16 in HE 71+ games.
Fixes crash during introduction of demo of farm (Updated)
svn-id: r19922
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/akos.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index c36fff7391..488ac89ff5 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -1162,7 +1162,7 @@ void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, in byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { Common::Rect clip; - int32 maxw, maxh; + int32 minx, miny, maxw, maxh; int32 skip_x, skip_y, cur_x, cur_y; byte transparency = (_vm->_heversion >= 61) ? palette[0] : 255; @@ -1180,26 +1180,18 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { clip.top = _actorY + ymoveCur; clip.right = clip.left + _width; clip.bottom = clip.top + _height; + + minx = miny = 0; maxw = _out.w; maxh = _out.h; if (_vm->_heversion >= 71) { if (_clipOverride.right > _clipOverride.left && _clipOverride.bottom > _clipOverride.top) { - if (clip.left < _clipOverride.left) - clip.left = _clipOverride.left; - - if (clip.right > _clipOverride.right) - clip.right = _clipOverride.right; - - if (clip.top < _clipOverride.top) - clip.top = _clipOverride.top; - - if (clip.bottom > _clipOverride.bottom) - clip.bottom = _clipOverride.bottom; + minx = _clipOverride.left; + miny = _clipOverride.top; + maxw = _clipOverride.right; + maxh = _clipOverride.bottom; } - - if (clip.isValidRect() == false) - return 0; } markRectAsDirty(clip); @@ -1209,7 +1201,7 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { cur_x = _width - 1; cur_y = _height - 1; - if (clip.left < 0) { + if (clip.left < minx) { skip_x = -clip.left; clip.left = 0; } @@ -1219,7 +1211,7 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { clip.right = maxw; } - if (clip.top < 0) { + if (clip.top < miny) { skip_y -= clip.top; clip.top = 0; } |