aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwinaphex2017-01-24 02:18:38 +0100
committertwinaphex2017-01-24 02:18:38 +0100
commit2747667a75d0512aaedfb166b7b92e9f99e14965 (patch)
treeecf5351f09b702b4589cc9ae26c5a06c510b3709
parent4744011506bd3419af2c0999eaf8f4df05f03bfd (diff)
downloadsnesemu-2747667a75d0512aaedfb166b7b92e9f99e14965.tar.gz
snesemu-2747667a75d0512aaedfb166b7b92e9f99e14965.tar.bz2
snesemu-2747667a75d0512aaedfb166b7b92e9f99e14965.zip
return false inside retro_load_game if game is NULL
-rw-r--r--libretro.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libretro.c b/libretro.c
index d7f20b0..e7b2e7a 100644
--- a/libretro.c
+++ b/libretro.c
@@ -873,21 +873,24 @@ static void init_descriptors(void)
bool retro_load_game(const struct retro_game_info* game)
{
+ struct retro_system_av_info av_info;
+ if (!game)
+ return false;
+
CPU.Flags = 0;
- init_descriptors();
- check_variables();
+ init_descriptors();
+ check_variables();
#ifdef LOAD_FROM_MEMORY_TEST
if (!LoadROM(game))
#else
- if (!LoadROM(game->path))
+ if (!LoadROM(game->path))
#endif
- return false;
+ return false;
Settings.FrameTime = (Settings.PAL ? Settings.FrameTimePAL :
- Settings.FrameTimeNTSC);
+ Settings.FrameTimeNTSC);
- struct retro_system_av_info av_info;
retro_get_system_av_info(&av_info);
#ifdef USE_BLARGG_APU