Implement index v3.

This commit is contained in:
2025-08-03 17:45:20 +01:00
parent bb18c9456b
commit 45c9b2c17f
5 changed files with 176 additions and 3 deletions

View File

@@ -151,7 +151,8 @@ void *aaruf_open(const char *filepath)
readBytes = fread(&signature, 1, sizeof(uint32_t), ctx->imageStream);
if(readBytes != sizeof(uint32_t) || (signature != IndexBlock && signature != IndexBlock2))
if(readBytes != sizeof(uint32_t) ||
(signature != IndexBlock && signature != IndexBlock2 && signature != IndexBlock3))
{
free(ctx);
errno = AARUF_ERROR_CANNOT_READ_INDEX;
@@ -163,6 +164,8 @@ void *aaruf_open(const char *filepath)
index_entries = process_index_v1(ctx);
else if(signature == IndexBlock2)
index_entries = process_index_v2(ctx);
else if(signature == IndexBlock3)
index_entries = process_index_v3(ctx);
if(index_entries == NULL)
{