Fixed crash when loading files that aren't ROMs (for example when accidentally dragging some file on DeSmuME's window).
This commit is contained in:
parent
343c013385
commit
72f363a4fb
|
@ -759,9 +759,12 @@ int NDS_LoadROM( const char *filename,
|
|||
break;
|
||||
}
|
||||
|
||||
type = ROM_NDS;
|
||||
if ( !strcmp(extROM, ".gba") && !strcmp(extROM2, ".ds"))
|
||||
type = ROM_DSGBA;
|
||||
if ( !strcmp(extROM, ".nds"))
|
||||
type = ROM_NDS;
|
||||
else if ( !strcmp(extROM, ".gba") && !strcmp(extROM2, ".ds"))
|
||||
type = ROM_DSGBA;
|
||||
else
|
||||
return -1;
|
||||
|
||||
file = reader->Init(filename);
|
||||
if (!file)
|
||||
|
|
Loading…
Reference in New Issue