From 349a5bc905d0106037e2701abec60054b68210ea Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Mon, 6 Aug 2012 17:46:14 +0000 Subject: [PATCH] sdl: fix a segfault in the cheat menu (sf bug #242) --- src/cheat.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cheat.cpp b/src/cheat.cpp index 3b39c5cb..ac35bad5 100644 --- a/src/cheat.cpp +++ b/src/cheat.cpp @@ -679,6 +679,15 @@ static int InitCheatComp(void) void FCEUI_CheatSearchSetCurrentAsOriginal(void) { uint32 x; + + if(!CheatComp) + { + if(InitCheatComp()) + { + CheatMemErr(); + return; + } + } for(x=0x000;x<0x10000;x++) if(!(CheatComp[x]&CHEATC_NOSHOW)) {