aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Kagerer2010-10-31 00:20:30 +0000
committerFlorian Kagerer2010-10-31 00:20:30 +0000
commitec680ef8aad8e82a14eb5a2af59fb72284919722 (patch)
tree0dc1c14ad6a5b01c6bd68b916051cdd2a78db0cc
parent917c4b00cb95f390ab75f77620c202866edb5254 (diff)
downloadscummvm-rg350-ec680ef8aad8e82a14eb5a2af59fb72284919722.tar.gz
scummvm-rg350-ec680ef8aad8e82a14eb5a2af59fb72284919722.tar.bz2
scummvm-rg350-ec680ef8aad8e82a14eb5a2af59fb72284919722.zip
LOL: fixed bug #3099321
(Crash in Yvel tavern basement) svn-id: r53973
-rw-r--r--engines/kyra/screen_v2.cpp6
-rw-r--r--engines/kyra/sprites_lol.cpp3
2 files changed, 9 insertions, 0 deletions
diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp
index 4d90bf2bab..9c224d1562 100644
--- a/engines/kyra/screen_v2.cpp
+++ b/engines/kyra/screen_v2.cpp
@@ -187,16 +187,22 @@ uint8 *Screen_v2::getPtrToShape(uint8 *shpFile, int shape) {
}
int Screen_v2::getShapeScaledWidth(const uint8 *shpFile, int scale) {
+ if (!shpFile)
+ return 0;
int width = READ_LE_UINT16(shpFile+3);
return (width * scale) >> 8;
}
int Screen_v2::getShapeScaledHeight(const uint8 *shpFile, int scale) {
+ if (!shpFile)
+ return 0;
int height = shpFile[2];
return (height * scale) >> 8;
}
uint16 Screen_v2::getShapeSize(const uint8 *shp) {
+ if (!shp)
+ return 0;
return READ_LE_UINT16(shp+6);
}
diff --git a/engines/kyra/sprites_lol.cpp b/engines/kyra/sprites_lol.cpp
index d199276235..6245ecdd1f 100644
--- a/engines/kyra/sprites_lol.cpp
+++ b/engines/kyra/sprites_lol.cpp
@@ -901,6 +901,9 @@ void LoLEngine::calcSpriteRelPosition(uint16 x1, uint16 y1, int &x2, int &y2, ui
}
void LoLEngine::drawDoor(uint8 *shape, uint8 *doorPalette, int index, int unk2, int w, int h, int flags) {
+ if (!shape)
+ return;
+
uint8 c = _dscDoor1[(_currentDirection << 5) + unk2];
int r = (c / 5) + 5 * _dscDimMap[index];
uint16 d = _dscShapeOvlIndex[r];