Fix bounds with negative sectors.

This commit is contained in:
2025-11-23 23:53:25 +00:00
parent fb88d4d04b
commit 176cab648b
2 changed files with 6 additions and 6 deletions

View File

@@ -297,7 +297,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector(void *context, const uint64_t se
return AARUF_ERROR_NOT_AARUFORMAT; return AARUF_ERROR_NOT_AARUFORMAT;
} }
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) if(negative && sector_address > ctx->user_data_ddt_header.negative)
{ {
FATAL("Sector address out of bounds"); FATAL("Sector address out of bounds");
@@ -868,7 +868,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_long(void *context, const uint64
return AARUF_ERROR_NOT_AARUFORMAT; return AARUF_ERROR_NOT_AARUFORMAT;
} }
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) if(negative && sector_address > ctx->user_data_ddt_header.negative)
{ {
FATAL("Sector address out of bounds"); FATAL("Sector address out of bounds");
@@ -1509,7 +1509,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_tag(const void *context, const u
return AARUF_ERROR_NOT_AARUFORMAT; return AARUF_ERROR_NOT_AARUFORMAT;
} }
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) if(negative && sector_address > ctx->user_data_ddt_header.negative)
{ {
FATAL("Sector address out of bounds"); FATAL("Sector address out of bounds");

View File

@@ -130,7 +130,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector(void *context, uint64_t sector_
return AARUF_READ_ONLY; return AARUF_READ_ONLY;
} }
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) if(negative && sector_address > ctx->user_data_ddt_header.negative)
{ {
FATAL("Sector address out of bounds"); FATAL("Sector address out of bounds");
@@ -569,7 +569,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector_long(void *context, uint64_t se
return AARUF_READ_ONLY; return AARUF_READ_ONLY;
} }
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) if(negative && sector_address > ctx->user_data_ddt_header.negative)
{ {
FATAL("Sector address out of bounds"); FATAL("Sector address out of bounds");
@@ -2101,7 +2101,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector_tag(void *context, const uint64
return AARUF_READ_ONLY; return AARUF_READ_ONLY;
} }
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1) if(negative && sector_address > ctx->user_data_ddt_header.negative)
{ {
FATAL("Sector address out of bounds"); FATAL("Sector address out of bounds");