From 57653b3f2873b59cbcf0f86858143523b74f5de7 Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Wed, 12 Dec 2012 21:25:31 -0800 Subject: Don't try to disassemble addresses beyond the end of the cartridge --- dis.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'dis.c') diff --git a/dis.c b/dis.c index a3d39fb..c3406f9 100644 --- a/dis.c +++ b/dis.c @@ -76,6 +76,9 @@ int main(int argc, char ** argv) break; } for(;;) { + if (address > filesize) { + break; + } visit(address); next = m68k_decode(encoded, &instbuf, address); address += (next-encoded)*2; -- cgit v1.2.3