do not initialize cheat system if memory size is 0 to avoid potential NPE

This commit is contained in:
Sven 2018-09-30 11:44:37 -04:00
parent 9ab3b1715d
commit adeff434fd

View File

@ -693,6 +693,10 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, bool wraparound)
return 0;
}
if ( meminfo.size == 0 )
{
return 0 ;
}
cheat_manager_state.actual_memory_size = (unsigned)meminfo.size;
cheat_manager_state.curr_memory_buf = meminfo.data;
cheat_manager_state.total_memory_size = (unsigned)meminfo.size;