From 17850c17519ff7268f2849f93efd9817e584c377 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 28 Oct 2016 16:51:54 -0700 Subject: [PATCH] Test: Fix patch loading in fuzzing frontend --- src/platform/test/fuzz-main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/platform/test/fuzz-main.c b/src/platform/test/fuzz-main.c index 30b611412..b8009f82e 100644 --- a/src/platform/test/fuzz-main.c +++ b/src/platform/test/fuzz-main.c @@ -80,15 +80,18 @@ int main(int argc, char** argv) { core->setVideoBuffer(core, outputBuffer, 256); } -#ifdef __AFL_HAVE_MANUAL_CONTROL - __AFL_INIT(); -#endif - #ifdef M_CORE_GBA if (core->platform(core) == PLATFORM_GBA) { ((struct GBA*) core->board)->hardCrash = false; } #endif + +#ifdef __AFL_HAVE_MANUAL_CONTROL + __AFL_INIT(); +#endif + if (args.patch) { + core->loadPatch(core, VFileOpen(args.patch, O_RDONLY)); + } mCoreLoadFile(core, args.fname); struct VFile* savestate = 0;