fix: corrupt data under Windows with mmap (fixes #82) (#87)

This commit is contained in:
Stéphane Lesimple
2024-02-18 12:26:41 +01:00
committed by GitHub
parent 16ea27d791
commit 8d24545c88

View File

@@ -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 */
}