diff options
author | Michael Pavone <pavone@retrodev.com> | 2019-03-19 09:27:30 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2019-03-19 09:27:30 -0700 |
commit | 09a3d3328ea4c204f55f5e9bfe83e4826bdd0405 (patch) | |
tree | 20dacd2819bc17ed27beb642d358731bec158776 /blastem.c | |
parent | b68d3a748caa80b43f5620d1ab3ec95d0a7ad2b3 (diff) |
Fix off-by-one error in code for loading an SMD format ROM from a ZIP archive
Diffstat (limited to 'blastem.c')
-rw-r--r-- | blastem.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -154,7 +154,7 @@ uint32_t load_rom_zip(const char *filename, void **dst) if (*dst) { if (is_smd_format(z->entries[i].name, *dst)) { size_t offset; - for (offset = 0; offset + SMD_BLOCK_SIZE + SMD_HEADER_SIZE < out_size; offset += SMD_BLOCK_SIZE) + for (offset = 0; offset + SMD_BLOCK_SIZE + SMD_HEADER_SIZE <= out_size; offset += SMD_BLOCK_SIZE) { uint8_t tmp[SMD_BLOCK_SIZE]; memcpy(tmp, *dst + offset + SMD_HEADER_SIZE, SMD_BLOCK_SIZE); |