mirror of https://github.com/mgba-emu/mgba.git
Test: Fix crash when fuzzing fails to load a file
This commit is contained in:
parent
422c3a25b8
commit
870c375cf6
1
CHANGES
1
CHANGES
|
@ -47,6 +47,7 @@ Bugfixes:
|
|||
- Core: Fix crash with rewind if savestates shrink
|
||||
- Test: Fix crash when loading invalid file
|
||||
- GBA Hardware: Fix crash if a savestate lies about game hardware
|
||||
- Test: Fix crash when fuzzing fails to load a file
|
||||
Misc:
|
||||
- SDL: Remove scancode key input
|
||||
- GBA Video: Clean up unused timers
|
||||
|
|
|
@ -94,10 +94,15 @@ int main(int argc, char** argv) {
|
|||
#ifdef __AFL_HAVE_MANUAL_CONTROL
|
||||
__AFL_INIT();
|
||||
#endif
|
||||
|
||||
bool cleanExit = true;
|
||||
if (!mCoreLoadFile(core, args.fname)) {
|
||||
cleanExit = false;
|
||||
goto loadError;
|
||||
}
|
||||
if (args.patch) {
|
||||
core->loadPatch(core, VFileOpen(args.patch, O_RDONLY));
|
||||
}
|
||||
mCoreLoadFile(core, args.fname);
|
||||
|
||||
struct VFile* savestate = 0;
|
||||
struct VFile* savestateOverlay = 0;
|
||||
|
@ -158,13 +163,14 @@ int main(int argc, char** argv) {
|
|||
savestateOverlay->close(savestateOverlay);
|
||||
}
|
||||
|
||||
loadError:
|
||||
freeArguments(&args);
|
||||
if (outputBuffer) {
|
||||
free(outputBuffer);
|
||||
}
|
||||
core->deinit(core);
|
||||
|
||||
return 0;
|
||||
return !cleanExit;
|
||||
}
|
||||
|
||||
static void _fuzzRunloop(struct mCore* core, int frames) {
|
||||
|
|
Loading…
Reference in New Issue