diff --git a/src/radbin/radbin.c b/src/radbin/radbin.c index 9788b5f7..fd3220dc 100644 --- a/src/radbin/radbin.c +++ b/src/radbin/radbin.c @@ -1152,6 +1152,13 @@ rb_thread_entry_point(void *p) { RDI_Parsed rdi = {0}; RDI_ParseStatus rdi_status = rdi_parse(f->data.str, f->data.size, &rdi); + U64 decompressed_size = rdi_decompressed_size_from_parsed(&rdi); + if(decompressed_size > rdi.raw_data_size) + { + U8 *decompressed_data = push_array_no_zero(arena, U8, decompressed_size); + rdi_decompress_parsed(decompressed_data, decompressed_size, &rdi); + rdi_status = rdi_parse(decompressed_data, decompressed_size, &rdi); + } switch(rdi_status) { default:{}break; diff --git a/src/rdi_make/rdi_make_local.c b/src/rdi_make/rdi_make_local.c index 70ccc333..d6678622 100644 --- a/src/rdi_make/rdi_make_local.c +++ b/src/rdi_make/rdi_make_local.c @@ -2982,12 +2982,7 @@ rdim_compress(Arena *arena, RDIM_SerializedSectionBundle *in) RDIM_SerializedSection *src = &in->sections[k]; RDIM_SerializedSection *dst = &out.sections[k]; MemoryCopyStruct(dst, src); - - // rjf: determine if this section should be compressed - B32 should_compress = 1; - - // rjf: compress if needed - if(should_compress) + if(src->encoded_size != 0) { MemoryZero(ctx.m_hashTable, sizeof(U16)*(1<data = push_array_no_zero(arena, U8, src->encoded_size);