From 07a1793fef88c32e25305fa33f0eaa68529e103f Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 15 Aug 2019 20:55:54 +0100 Subject: [PATCH] Fix not reading MODE2 sectors with EDC/ECC correctly. --- src/read.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/read.c b/src/read.c index 58e15d0..165c911 100644 --- a/src/read.c +++ b/src/read.c @@ -325,6 +325,13 @@ int32_t read_sector_long(void* context, uint8_t* data, uint64_t sectorAddress, u if((ctx->sectorSuffixDdt[sectorAddress] & CD_XFIX_MASK) == Mode2Form2Ok) ecc_cd_reconstruct(ctx->eccCdContext, data, CdMode2Form2); } + else if((ctx->sectorSuffixDdt[sectorAddress] & CD_XFIX_MASK) == NotDumped) + { + res = DICF_STATUS_SECTOR_NOT_DUMPED; + } + else + // Mode 2 where ECC failed + memcpy(data + 24, bareData, 2328); } else if(ctx->mode2Subheaders != NULL) {