From 83e1ed5cb61a43ff139dd241434386e0945e3897 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 12 Oct 2022 16:22:33 +0100 Subject: [PATCH] Fix returning proper status in aaruf_read_sector_long(). --- src/read.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/read.c b/src/read.c index 6bb474c..ae1d590 100644 --- a/src/read.c +++ b/src/read.c @@ -365,6 +365,8 @@ int32_t aaruf_read_sector_long(void* context, uint64_t sectorAddress, uint8_t* d else return AARUF_ERROR_REACHED_UNREACHABLE_CODE; + if(res != AARUF_STATUS_OK) return res; + if(ctx->sectorSuffix != NULL) memcpy(data + 2064, ctx->sectorSuffix + sectorAddress * 288, 288); else if(ctx->sectorSuffixDdt != NULL) { @@ -415,6 +417,8 @@ int32_t aaruf_read_sector_long(void* context, uint64_t sectorAddress, uint8_t* d else return AARUF_ERROR_REACHED_UNREACHABLE_CODE; + if(res != AARUF_STATUS_OK) return res; + if(ctx->mode2Subheaders != NULL && ctx->sectorSuffixDdt != NULL) { memcpy(data + 16, ctx->mode2Subheaders + sectorAddress * 8, 8);