Skip to content

Commit

Permalink
fix: corrupt data under Windows with mmap (fixes #82) (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
speed47 authored Feb 18, 2024
1 parent 16ea27d commit 8d24545
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rs03-create.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,14 +703,18 @@ static void read_next_chunk(ecc_closure *ec, guint64 chunk)
(unless we are already in the last chunk).
Additional space is provided in the ec->ioData buffer. */

#ifdef HAVE_MMAP
if(Closure->encodingIOStrategy == IO_STRATEGY_READWRITE)
{
#endif
if(ec->ioChunk+ec->ioLayerSectors < lay->sectorsPerLayer)
{
RS03ReadSectors(ec->image, lay, ec->ioData[layer]+ec->chunkBytes,
layer, ec->ioChunk+ec->ioLayerSectors, 1, RS03_READ_DATA);
}
#ifdef HAVE_MMAP
}
#endif
} /* all layers from chunk finished */
}

Expand Down

0 comments on commit 8d24545

Please sign in to comment.