libredwg
libredwg copied to clipboard
Issue with block table parsing in preR13
There is issue in block table parsing in preR13 Example: BLOCK1.DXF.gz BLOCK1.DWG.gz
Actual parsing:
...
blocks 0x46c (0xfffffb94) - 0x0 (0x48, 0x80000000)
...
and code in src/decode.c:
...
error |= decode_preR13_entities (blocks_start, blocks_end,
blocks_start - blocks_offset, dat, dwg);
...
This doesn't work because blocks_end is 0. We need to use block_start + modified block_offset (& 0x00ffffff)
Yes, fixed in 16f6c1f97b20fd8fdec1c595e24d2fa81801afce But I dont trust the size calculation with the mask yet. I rather loop over the number of entities.
@rurban Thanks. I will test. FYI: Mask works for me.
yes, I re-introduced the mask, but renamed the field to size again. it's not an offset.
@rurban great
@rurban This change doesn't work. You added num_entities to decode_preR13_entities(), but we don't know this value from R_10. In <R_10 is in header. I believe that only thing how to do is while() and check entities_end value.
Something like this: https://github.com/LibreDWG/libredwg/pull/452
Fix for this issue: https://github.com/LibreDWG/libredwg/pull/559