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:
luigi__ 2009-06-05 12:11:09 +00:00
parent 343c013385
commit 72f363a4fb
1 changed files with 6 additions and 3 deletions

View File

@ -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)