aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2008-05-13 16:12:37 +0000
committerFilippos Karapetis2008-05-13 16:12:37 +0000
commit3c119e17cbbaf4183a387a761e55c8e753589d6a (patch)
tree154cdf69d064679010042aed6a4777bdab80ca07
parent85d28316ac2d513df8609ef7a39cc26a179f1078 (diff)
downloadscummvm-rg350-3c119e17cbbaf4183a387a761e55c8e753589d6a.tar.gz
scummvm-rg350-3c119e17cbbaf4183a387a761e55c8e753589d6a.tar.bz2
scummvm-rg350-3c119e17cbbaf4183a387a761e55c8e753589d6a.zip
Added a sanity check to o1_LOADCURSOR to prevent LGoP2 from crashing when the save/load menu is opened during character selection
svn-id: r32089
-rw-r--r--engines/made/scriptfuncs_lgop2.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/made/scriptfuncs_lgop2.cpp b/engines/made/scriptfuncs_lgop2.cpp
index 73fbd7fb45..d90e6546d7 100644
--- a/engines/made/scriptfuncs_lgop2.cpp
+++ b/engines/made/scriptfuncs_lgop2.cpp
@@ -443,6 +443,9 @@ int16 ScriptFunctionsLgop2::o1_OUTLINE(int16 argc, int16 *argv) {
int16 ScriptFunctionsLgop2::o1_LOADCURSOR(int16 argc, int16 *argv) {
PictureResource *flex = _vm->_res->getPicture(argv[2]);
+ if (!flex)
+ return 0;
+
Graphics::Surface *surf = flex->getPicture();
CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
CursorMan.showMouse(true);