From 21d69fa02a5af36c3548f620f5c2ca1f38b2cba1 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 30 Mar 2021 18:33:32 -0700 Subject: [PATCH] GBA: Fix crash when ROM loading fails --- CHANGES | 1 + src/gba/gba.c | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 8148926e7..ff21563db 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,7 @@ Emulation fixes: - GBA Memory: Fix loading Thumb savestates when in ARM mode Other fixes: - GBA: Fix FireRed revision misdetecting as a ROM hack + - GBA: Fix crash when ROM loading fails Misc: - Qt: Add ROM filename and size to bug reporter diff --git a/src/gba/gba.c b/src/gba/gba.c index 3daa8489f..a328b55da 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -411,6 +411,7 @@ bool GBALoadROM(struct GBA* gba, struct VFile* vf) { gba->memory.romSize = gba->pristineRomSize; } if (!gba->memory.rom) { + gba->romVf = NULL; mLOG(GBA, WARN, "Couldn't map ROM"); return false; }