@@ -9896,46 +9896,43 @@ DWG_OBJECT (DIMASSOC)
9896
9896
FIELD_B (trans_space_flag , 70 );
9897
9897
FIELD_RC (rotated_type , 71 );
9898
9898
FIELD_HANDLE (dimensionobj , 4 , 330 );
9899
- REPEAT_CN (4 , ref , Dwg_DIMASSOC_Ref ) // i.e. AcDbOsnapPointRef
9899
+ // 6 = maximum of items
9900
+ REPEAT_CN (6 , ref , Dwg_DIMASSOC_Ref ) // i.e. AcDbOsnapPointRef
9900
9901
REPEAT_BLOCK
9901
- // TODO: there could be much more blocks, up to 5.
9902
- // 0 1 2 3 => 1 2 4 8. skip unset bits
9903
- if (!(FIELD_VALUE (associativity ) & (1 <<rcount1 )))
9902
+ // 35 is minimal size of item
9903
+ if (dat - > byte + 35 > dat - > size )
9904
9904
{
9905
- #ifdef IS_JSON
9906
- ENDHASH ;
9907
- #endif
9908
- continue ;
9905
+ break ;
9909
9906
}
9910
9907
LOG_HANDLE ("DIMASSOC_Ref .rcount1 : %d \n ", rcount1 );
9911
- // DXF: 1, 72, 10, ??, 75
9912
9908
SUB_FIELD_T (ref [rcount1 ], classname , 1 ); // "AcDbOsnapPointRef"
9913
9909
SUB_FIELD_RC (ref [rcount1 ], osnap_type , 72 ); // 0-13
9914
9910
// idpaths:
9915
- SUB_FIELD_BL0 (ref [rcount1 ], num_intsectobj , 74 );
9916
- SUB_HANDLE_VECTOR (ref [rcount1 ], intsectobj , num_intsectobj , 5 , 332 );
9911
+ SUB_FIELD_BL (ref [rcount1 ], num_xrefs , 0 );
9912
+ SUB_HANDLE_VECTOR (ref [rcount1 ], xrefs , num_xrefs , 4 , 331 ) ;
9913
+
9914
+ if (FIELD_VALUE (ref [rcount1 ].osnap_type ) != 0 )
9915
+ {
9916
+ SUB_FIELD_BL (ref [rcount1 ], main_subent_type , 73 );
9917
+ SUB_FIELD_BL (ref [rcount1 ], main_gsmarker , 91 );
9918
+ SUB_FIELD_BL (ref [rcount1 ], num_xrefpaths , 0 );
9919
+ FIELD_VECTOR_T (ref [rcount1 ].xrefpaths , T , ref [rcount1 ].num_xrefpaths , 301 )
9920
+ }
9917
9921
9918
9922
SUB_FIELD_BD (ref [rcount1 ], osnap_dist , 40 );
9919
9923
SUB_FIELD_3BD (ref [rcount1 ], osnap_pt , 10 );
9920
9924
9921
- // XrefFullSubentPath
9922
- SUB_FIELD_BL (ref [rcount1 ], num_xrefs , 0 ); // 1 or 2
9923
- SUB_VALUEOUTOFBOUNDS (ref [rcount1 ], num_xrefs , 100 )
9924
- SUB_HANDLE_VECTOR (ref [rcount1 ], xrefs , num_xrefs , 4 , 331 );
9925
-
9926
9925
// restrict only when writing, not when reading?
9927
- //if (FIELD_VALUE (ref[rcount1].osnap_type) == 6 || FIELD_VALUE (ref[rcount1].osnap_type) == 11)
9928
- // {
9929
- SUB_FIELD_BL0 (ref [rcount1 ], main_subent_type , 73 );
9930
- SUB_FIELD_BL (ref [rcount1 ], main_gsmarker , 91 );
9931
- SUB_FIELD_BL (ref [rcount1 ], num_xrefpaths , 0 );
9932
- FIELD_VECTOR_T (ref [rcount1 ].xrefpaths , T , ref [rcount1 ].num_xrefpaths , 301 )
9933
- // }
9934
- SUB_FIELD_B (ref [rcount1 ], has_lastpt_ref , 75 );
9935
- if (FIELD_VALUE (ref [rcount1 ].has_lastpt_ref ))
9926
+ if (FIELD_VALUE (ref [rcount1 ].osnap_type ) == 6 || FIELD_VALUE (ref [rcount1 ].osnap_type ) == 11 )
9936
9927
{
9937
- SUB_FIELD_3BD (ref [rcount1 ], lastpt_ref , 0 );
9928
+ SUB_FIELD_BL (ref [rcount1 ], num_intsectobj , 0 );
9929
+ SUB_HANDLE_VECTOR (ref [rcount1 ], intsectobj , num_intsectobj , 5 , 332 );
9930
+ SUB_FIELD_BL (ref [rcount1 ], intersec_subent_type , 74 );
9931
+ SUB_FIELD_BL (ref [rcount1 ], intersec_gsmarker , 92 );
9932
+ SUB_FIELD_BL (ref [rcount1 ], num_intersec_xrefpaths , 0 );
9933
+ FIELD_VECTOR_T (ref [rcount1 ].intersec_xrefpaths , T , ref [rcount1 ].num_intersec_xrefpaths , 302 )
9938
9934
}
9935
+ SUB_FIELD_B (ref [rcount1 ], has_lastpt_ref , 75 );
9939
9936
SET_PARENT_OBJ (ref [rcount1 ]);
9940
9937
END_REPEAT_BLOCK
9941
9938
END_REPEAT (ref )
0 commit comments