mirror of https://github.com/mgba-emu/mgba.git
GB, GBA: Fix crashes when attempting to identify null VFiles
This commit is contained in:
parent
8684a0b221
commit
0d6a0ed375
1
CHANGES
1
CHANGES
|
@ -10,6 +10,7 @@ Bugfixes:
|
|||
- GB Core: Fix palette loading when loading a foreign config
|
||||
- Qt: Fix LOG argument order
|
||||
- GB Memory: Prevent accessing empty SRAM (fixes mgba.io/i/831)
|
||||
- GB, GBA: Fix crashes when attempting to identify null VFiles
|
||||
Misc:
|
||||
- Qt: Don't rebuild library view if style hasn't changed
|
||||
- SDL: Fix 2.0.5 build on macOS under some circumstances
|
||||
|
|
|
@ -655,6 +655,9 @@ void GBIllegal(struct LR35902Core* cpu) {
|
|||
}
|
||||
|
||||
bool GBIsROM(struct VFile* vf) {
|
||||
if (!vf) {
|
||||
return false;
|
||||
}
|
||||
vf->seek(vf, 0x104, SEEK_SET);
|
||||
uint8_t header[4];
|
||||
|
||||
|
|
|
@ -475,6 +475,9 @@ void GBADebug(struct GBA* gba, uint16_t flags) {
|
|||
}
|
||||
|
||||
bool GBAIsROM(struct VFile* vf) {
|
||||
if (!vf) {
|
||||
return false;
|
||||
}
|
||||
if (vf->seek(vf, GBA_ROM_MAGIC_OFFSET, SEEK_SET) < 0) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue