Implement support for index v2.

This commit is contained in:
2025-08-01 21:18:48 +01:00
parent 4f25209145
commit 9a4c04b2ca
8 changed files with 224 additions and 71 deletions

View File

@@ -152,7 +152,7 @@ void *aaruf_open(const char *filepath)
readBytes = fread(&signature, 1, sizeof(uint32_t), ctx->imageStream);
if(readBytes != sizeof(uint32_t) || signature != IndexBlock)
if(readBytes != sizeof(uint32_t) || (signature != IndexBlock && signature != IndexBlock2))
{
free(ctx);
errno = AARUF_ERROR_CANNOT_READ_INDEX;
@@ -160,7 +160,10 @@ void *aaruf_open(const char *filepath)
return NULL;
}
index_entries = process_index_v1(ctx);
if(signature == IndexBlock)
index_entries = process_index_v1(ctx);
else if(signature == IndexBlock2)
index_entries = process_index_v2(ctx);
if(index_entries == NULL)
{