diff options
author | Adrien Plazas <kekun.plazas@laposte.net> | 2020-12-12 14:09:34 +0100 |
---|---|---|
committer | twinaphex <libretro@gmail.com> | 2021-03-12 08:42:23 +0100 |
commit | da869b41fbb3bfb2c31798abf01e648d6dc15221 (patch) | |
tree | c6ebbc4c2b5d3441032070c1b2051ab7d7cdbbbd /genesis.c | |
parent | 556e1be14b3f1647f8e07d47694c971ba5ee296e (diff) |
Stop loading at the end of a file
When section 0 is found, assume we reached the end of the serialization,
so stop deserializing.
Diffstat (limited to 'genesis.c')
-rw-r--r-- | genesis.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -211,7 +211,8 @@ void genesis_deserialize(deserialize_buffer *buf, genesis_context *gen) gen->tmss = 0xFF; while (buf->cur_pos < buf->size) { - load_section(buf); + if (!load_section(buf)) + break; } if (gen->version_reg & 0xF) { if (gen->tmss == 0xFF) { |