diff --git a/src/decode.c b/src/decode.c index 1b9b3b2..e9c2c6e 100644 --- a/src/decode.c +++ b/src/decode.c @@ -2169,6 +2169,13 @@ dwg_decode_handleref_with_code(Bit_Chain * dat, Dwg_Object * obj, Dwg_Data* dwg, { Dwg_Object_Ref * ref; ref = dwg_decode_handleref(dat, obj, dwg); + + if (!ref) + { + LOG_ERROR("dwg_decode_handleref_with_code: ref is a null pointer\n"); + return 0; + } + if (ref->absolute_ref == 0 && ref->handleref.code != code) { LOG_ERROR("Expected a CODE %d handle, got a %d\n", code, ref->handleref.code) diff --git a/src/dwg.h b/src/dwg.h index 13f2b51..94413d3 100644 --- a/src/dwg.h +++ b/src/dwg.h @@ -1272,7 +1272,7 @@ typedef struct _dwg_entity_LEADER BITCODE_3DPOINT end_pt_proj; BITCODE_3DPOINT extrusion; BITCODE_3DPOINT x_direction; - BITCODE_3DPOINT offset_block_inspt; + BITCODE_3DPOINT offset_to_block_ins_pt; BITCODE_3DPOINT unknown_pt; BITCODE_BD dimgap; BITCODE_BD box_height; @@ -2220,7 +2220,7 @@ typedef struct _dwg_object_RASTERVARIABLES typedef struct _dwg_object_SORTENTSTABLE { BITCODE_BL num_entries; - BITCODE_H sort_handle; + BITCODE_H* sort_handles; BITCODE_H parenthandle; BITCODE_H* reactors; BITCODE_H xdicobjhandle; diff --git a/src/dwg.spec b/src/dwg.spec index b2103d4..88b35a3 100644 --- a/src/dwg.spec +++ b/src/dwg.spec @@ -1465,6 +1465,7 @@ DWG_ENTITY(LEADER); FIELD_3DPOINT(end_pt_proj); FIELD_3DPOINT(extrusion); FIELD_3DPOINT(x_direction); + FIELD_3DPOINT(offset_to_block_ins_pt); SINCE(R_14) { @@ -2702,7 +2703,7 @@ DWG_OBJECT_END DWG_OBJECT(SORTENTSTABLE); FIELD_BL (num_entries); - FIELD_HANDLE (sort_handle, 0); + HANDLE_VECTOR (sort_handles, num_entries, 0); FIELD_HANDLE (parenthandle, 4); REACTORS(4); XDICOBJHANDLE(3);