Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/lib_rdi/rdi_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,17 @@ rdi_section_raw_element_from_kind_idx(RDI_Parsed *rdi, RDI_SectionKind kind, RDI
RDI_PROC RDI_U64
rdi_decompressed_size_from_parsed(RDI_Parsed *rdi)
{
RDI_U64 decompressed_size = rdi->raw_data_size;
RDI_Header *hdr = (RDI_Header *)rdi->raw_data;
U64 off = hdr->data_section_off + sizeof(RDI_Section) * rdi->sections_count;
off += 7;
off -= off%8;
for(RDI_U64 section_idx = 0; section_idx < rdi->sections_count; section_idx += 1)
{
decompressed_size += (rdi->sections[section_idx].unpacked_size - rdi->sections[section_idx].encoded_size);
off += rdi->sections[section_idx].unpacked_size;
off += 7;
off -= off%8;
}
return decompressed_size;
return off;
}

//- decompression
Expand Down