mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Initialize index entries array and update index management for DDT entries
This commit is contained in:
16
src/create.c
16
src/create.c
@@ -165,6 +165,22 @@ void *aaruf_create(const char *filepath, uint32_t mediaType, uint32_t sectorSize
|
||||
|
||||
if(ctx->userDataDdtHeader.blocks % (1 << ctx->userDataDdtHeader.tableShift) != 0) ctx->userDataDdtHeader.entries++;
|
||||
|
||||
// Initialize index entries array
|
||||
TRACE("Initializing index entries array");
|
||||
UT_icd index_entry_icd = {sizeof(IndexEntry), NULL, NULL, NULL};
|
||||
utarray_new(ctx->indexEntries, &index_entry_icd);
|
||||
|
||||
if(ctx->indexEntries == NULL)
|
||||
{
|
||||
FATAL("Not enough memory to create index entries array");
|
||||
free(ctx->readableSectorTags);
|
||||
free(ctx);
|
||||
errno = AARUF_ERROR_NOT_ENOUGH_MEMORY;
|
||||
|
||||
TRACE("Exiting aaruf_create() = NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Is writing
|
||||
ctx->isWriting = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user