GBA: Fix crash when ROM loading fails

This commit is contained in:
Vicki Pfau 2021-03-30 18:33:32 -07:00
parent 30ed94e803
commit 21d69fa02a
2 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,7 @@ Emulation fixes:
- GBA Memory: Fix loading Thumb savestates when in ARM mode - GBA Memory: Fix loading Thumb savestates when in ARM mode
Other fixes: Other fixes:
- GBA: Fix FireRed revision misdetecting as a ROM hack - GBA: Fix FireRed revision misdetecting as a ROM hack
- GBA: Fix crash when ROM loading fails
Misc: Misc:
- Qt: Add ROM filename and size to bug reporter - Qt: Add ROM filename and size to bug reporter

View File

@ -411,6 +411,7 @@ bool GBALoadROM(struct GBA* gba, struct VFile* vf) {
gba->memory.romSize = gba->pristineRomSize; gba->memory.romSize = gba->pristineRomSize;
} }
if (!gba->memory.rom) { if (!gba->memory.rom) {
gba->romVf = NULL;
mLOG(GBA, WARN, "Couldn't map ROM"); mLOG(GBA, WARN, "Couldn't map ROM");
return false; return false;
} }