Skip to content

Commit 99c0c5d

Browse files
Fix some REAL xdata types
dwg_resbuf_value_type missed some REAL and POINT3D ranges. Fixes GH #1178 Co-authored-by: Reini Urban <reini.urban@gmail.com>
1 parent 37e4f5a commit 99c0c5d

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/dwg.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,8 +1868,12 @@ dwg_resbuf_value_type (short gc)
18681868
return DWG_VT_BINARY;
18691869
if (gc <= 1009)
18701870
return DWG_VT_STRING;
1871-
if (gc <= 1059)
1871+
if (gc <= 1039)
1872+
return DWG_VT_POINT3D;
1873+
if (gc <= 1042)
18721874
return DWG_VT_REAL;
1875+
if (gc <= 1069)
1876+
return DWG_VT_POINT3D;
18731877
if (gc <= 1070)
18741878
return DWG_VT_INT16;
18751879
if (gc == 1071)
@@ -1912,6 +1916,8 @@ dwg_resbuf_value_type (short gc)
19121916
return DWG_VT_BINARY;
19131917
if (gc <= 329)
19141918
return DWG_VT_HANDLE;
1919+
/* 330-340 SoftPointer, 340-349 HardPointer
1920+
350-359 SoftOwner, 360-369 HardOwner */
19151921
if (gc <= 369)
19161922
return DWG_VT_OBJECTID;
19171923
if (gc <= 389)
@@ -1923,10 +1929,8 @@ dwg_resbuf_value_type (short gc)
19231929
{
19241930
if (gc >= 210) // 210-299
19251931
{
1926-
if (gc <= 239)
1927-
return DWG_VT_REAL;
19281932
if (gc <= 269)
1929-
return DWG_VT_INVALID;
1933+
return DWG_VT_POINT3D;
19301934
if (gc <= 279)
19311935
return DWG_VT_INT16;
19321936
if (gc <= 289)
@@ -1940,6 +1944,8 @@ dwg_resbuf_value_type (short gc)
19401944
return DWG_VT_HANDLE;
19411945
if (gc <= 109)
19421946
return DWG_VT_INVALID;
1947+
if (gc <= 139)
1948+
return DWG_VT_POINT3D;
19431949
if (gc <= 149)
19441950
return DWG_VT_REAL;
19451951
if (gc <= 169) // e.g. REQUIREDVERSIONS 160 r2013+
@@ -1960,9 +1966,7 @@ dwg_resbuf_value_type (short gc)
19601966
return DWG_VT_INT16;
19611967
if (gc <= 99)
19621968
return DWG_VT_INT32;
1963-
if (gc <= 101)
1964-
return DWG_VT_STRING;
1965-
if (gc == 102)
1969+
if (gc <= 102)
19661970
return DWG_VT_STRING;
19671971
}
19681972
else // 0-37

0 commit comments

Comments
 (0)