mirror of
https://github.com/libretro/beetle-pce-fast-libretro.git
synced 2024-11-22 23:39:50 +00:00
Prevent crash if BIOS is missing
This commit is contained in:
parent
b9676d5a8a
commit
f513db405e
12
libretro.cpp
12
libretro.cpp
@ -1139,7 +1139,10 @@ static int HuCLoadCD(const char *bios_path)
|
|||||||
MDFNFILE *fp = file_open(bios_path);
|
MDFNFILE *fp = file_open(bios_path);
|
||||||
|
|
||||||
if(!fp)
|
if(!fp)
|
||||||
|
{
|
||||||
|
MDFN_DispMessage("Firmware not found: '%s'", bios_path);
|
||||||
return(0);
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
memset(ROMSpace, 0xFF, 262144);
|
memset(ROMSpace, 0xFF, 262144);
|
||||||
|
|
||||||
@ -2419,12 +2422,13 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
|
|||||||
|
|
||||||
void retro_deinit(void)
|
void retro_deinit(void)
|
||||||
{
|
{
|
||||||
if (surf->pixels)
|
|
||||||
free(surf->pixels);
|
|
||||||
surf->pixels = NULL;
|
|
||||||
|
|
||||||
if (surf)
|
if (surf)
|
||||||
|
{
|
||||||
|
if (surf->pixels)
|
||||||
|
free(surf->pixels);
|
||||||
|
surf->pixels = NULL;
|
||||||
free(surf);
|
free(surf);
|
||||||
|
}
|
||||||
surf = NULL;
|
surf = NULL;
|
||||||
|
|
||||||
if (log_cb)
|
if (log_cb)
|
||||||
|
Loading…
Reference in New Issue
Block a user