diff options
author | Paul Gilbert | 2012-01-21 20:47:08 +1100 |
---|---|---|
committer | Strangerke | 2012-04-06 08:20:31 +0200 |
commit | 3fa59e95199002ec4ed6e4285be4f7234c257da0 (patch) | |
tree | a213e1a3c3ee9c3f592f00c927d805c2de30f8dc | |
parent | 90e076a36a25e79262848d0820f04d4fe1e5cc8f (diff) | |
download | scummvm-rg350-3fa59e95199002ec4ed6e4285be4f7234c257da0.tar.gz scummvm-rg350-3fa59e95199002ec4ed6e4285be4f7234c257da0.tar.bz2 scummvm-rg350-3fa59e95199002ec4ed6e4285be4f7234c257da0.zip |
MORTEVIELLE: Bugfix for image block decoding method #0
-rw-r--r-- | engines/mortevielle/graphics.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp index 034a60c505..3683afc57b 100644 --- a/engines/mortevielle/graphics.cpp +++ b/engines/mortevielle/graphics.cpp @@ -129,6 +129,7 @@ void GfxSurface::decode(const byte *pSrc) { int srcSize = READ_BE_UINT16(pSrc + 2); _xp = READ_BE_UINT16(pSrc + 4) - _offset.x; _yp = READ_BE_UINT16(pSrc + 6) - _offset.y; + assert((_xp >= 0) && (_yp >= 0) && (_xp < SCREEN_WIDTH) && (_yp < SCREEN_ORIG_HEIGHT)); pSrc += 8; int decomCode = READ_BE_UINT16(pSrc); @@ -242,7 +243,7 @@ void GfxSurface::decode(const byte *pSrc) { } } - pSrc = pSrcStart + lookupBytes + ((lookupBytes & 1) ? 1 : 0); + pSrcStart += lookupBytes + ((lookupBytes & 1) ? 1 : 0); break; case 1: @@ -399,6 +400,9 @@ void GfxSurface::decode(const byte *pSrc) { _xEnd = _xSize; diag(pSrc, pDest, pLookup); break; + + default: + error("Unknown decompression block type %d", decomIndex); } pSrc = pSrcStart; |