From 3c119e17cbbaf4183a387a761e55c8e753589d6a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 13 May 2008 16:12:37 +0000 Subject: 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 --- engines/made/scriptfuncs_lgop2.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/made') 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); -- cgit v1.2.3