diff --git a/mz_strm_split.c b/mz_strm_split.c index a50392c5..9cb6ca24 100644 --- a/mz_strm_split.c +++ b/mz_strm_split.c @@ -243,10 +243,11 @@ int32_t mz_stream_split_read(void *stream, void *buf, int32_t size) { if (read == 0) { if (split->current_disk < 0) /* No more disks to goto */ break; + if (size != bytes_left) /* Report read from previous disk before switching */ + break; err = mz_stream_split_goto_disk(stream, split->current_disk + 1); - if (err == MZ_EXIST_ERROR) { + if (err == MZ_EXIST_ERROR) split->current_disk = -1; - } if (err != MZ_OK) return err; }