From 8b7922b6798ef51288e5400e7a2e78ab810656d4 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 15 Jun 2019 03:42:53 +0300 Subject: [PATCH] Fix #144 by ignored malformed commands with 0 length --- Core/sgb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core/sgb.c b/Core/sgb.c index 6b1dbd0..0944985 100644 --- a/Core/sgb.c +++ b/Core/sgb.c @@ -98,6 +98,9 @@ static void command_ready(GB_gameboy_t *gb) return; } + /* Ignore malformed commands (0 length)*/ + if ((gb->sgb->command[0] & 7) == 0) return; + switch (gb->sgb->command[0] >> 3) { case PAL01: pal_command(gb, 0, 1);