aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBenjamin Haisch2008-05-28 20:12:01 +0000
committerBenjamin Haisch2008-05-28 20:12:01 +0000
commitdf0e072a1b59011a4f37b41f9ae53036c3682e8f (patch)
tree0ac5ebd400c078793cfe35b59803f21e206d9beb /engines
parent057af1000f5187a93fc1ac1a5f61a7a6a382bf03 (diff)
downloadscummvm-rg350-df0e072a1b59011a4f37b41f9ae53036c3682e8f.tar.gz
scummvm-rg350-df0e072a1b59011a4f37b41f9ae53036c3682e8f.tar.bz2
scummvm-rg350-df0e072a1b59011a4f37b41f9ae53036c3682e8f.zip
Fixed a crash in LGOP2 when attempting to get a sprite item from an empty array.
svn-id: r32348
Diffstat (limited to 'engines')
-rw-r--r--engines/made/screen.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp
index 754a45016c..a480a3bc0c 100644
--- a/engines/made/screen.cpp
+++ b/engines/made/screen.cpp
@@ -819,7 +819,13 @@ int16 Screen::addToSpriteList(int16 index, int16 xofs, int16 yofs) {
}
SpriteListItem Screen::getFromSpriteList(int16 index) {
- return _spriteList[index - 1];
+ if (index > _spriteList.size()) {
+ SpriteListItem emptyItem;
+ emptyItem.index = 0;
+ return emptyItem;
+ } else {
+ return _spriteList[index - 1];
+ }
}
void Screen::clearSpriteList() {