diff options
author | Johannes Schickel | 2008-05-10 19:29:13 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-05-10 19:29:13 +0000 |
commit | 5082419fe9957ca144904fe2cdb3e86ff7b36e1f (patch) | |
tree | eef899bcacc181368c243a8ba079490bfde5e732 /engines | |
parent | 7c7e9b831fc8b250942170bc12cd9c54602ded48 (diff) | |
download | scummvm-rg350-5082419fe9957ca144904fe2cdb3e86ff7b36e1f.tar.gz scummvm-rg350-5082419fe9957ca144904fe2cdb3e86ff7b36e1f.tar.bz2 scummvm-rg350-5082419fe9957ca144904fe2cdb3e86ff7b36e1f.zip |
Fixed bug in Screen_v2::makeShapeCopy.
svn-id: r31986
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/screen_v2.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 6c4adea88c..597f81d843 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -225,14 +225,12 @@ void KyraEngine_v2::addShapeToPool(const uint8 *data, int realIndex, int shape) debugC(9, kDebugLevelMain, "KyraEngine_v2::addShapeToPool(%p, %d, %d)", data, realIndex, shape); remShapeFromPool(realIndex); _gameShapes[realIndex] = screen_v2()->makeShapeCopy(data, shape); - assert(_gameShapes[realIndex]); } void KyraEngine_v2::addShapeToPool(uint8 *shpData, int index) { debugC(9, kDebugLevelMain, "KyraEngine_v2::addShapeToPool(%p, %d)", shpData, index); remShapeFromPool(index); _gameShapes[index] = shpData; - assert(_gameShapes[index]); } void KyraEngine_v2::remShapeFromPool(int idx) { diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp index 704296c534..564282fb3f 100644 --- a/engines/kyra/screen_v2.cpp +++ b/engines/kyra/screen_v2.cpp @@ -290,6 +290,9 @@ uint8 *Screen_v2::makeShapeCopy(const uint8 *src, int index) { debugC(9, kDebugLevelScreen, "Screen_v2::makeShapeCopy(%p, %d)", (const void *)src, index); const uint8 *shape = getPtrToShape(src, index); + if (!shape) + return 0; + int size = getShapeSize(shape); uint8 *copy = new uint8[size]; |