mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Implement support for index v2.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user