summaryrefslogtreecommitdiff
path: root/dis.c
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2012-12-12 21:25:31 -0800
committerMike Pavone <pavone@retrodev.com>2012-12-12 21:25:31 -0800
commit57653b3f2873b59cbcf0f86858143523b74f5de7 (patch)
treed48cc9e80954167ea21d9e31af0b17e07cb81d70 /dis.c
parentd1fc71b12e97f6397f781565c44a6ee84441b2b5 (diff)
Don't try to disassemble addresses beyond the end of the cartridge
Diffstat (limited to 'dis.c')
-rw-r--r--dis.c3
1 files changed, 3 insertions, 0 deletions
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;