aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/kyra_v2.cpp2
-rw-r--r--engines/kyra/screen_v2.cpp3
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];