forked from LibreDWG/libredwg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog
14581 lines (9751 loc) · 425 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Full history from the git log
-----------------------------
2019-10-06 Reini Urban <[email protected]>
Release 0.9
2019-10-05 Reini Urban <[email protected]>
indxf: fix VIEW_CONTROL 70 -1
which appears in the wild.
fix get_next_owned_entity
esp needed for dwg2dxf, which missed the very last
block entity. Fixes GH #143, thanks to @soundd1
dxf: fix BLOCK.base_pt
take it from the BLOCK_HEADER. see GH #143
fix bit_convert_TU for >U+0800
a major blunder. wrong order of bytes AND wrong numbers.
thanks to some chinese examples with chinese application names,
esp. GH #109 and #143
2019-10-04 Reini Urban <[email protected]>
fix int overflows
detected by lgtm
dxf: VALUEOUTOFBOUNDS CellStyle.num_borders
overflow with gh143/testBlock
regen broken 2000/TS1.dxf example
it could not even be loaded by acad
dxf: fix FIELD_BSd formatting
%6i, not %d.
E.g. $DIMLWE
bindings: add dynapi
2019-10-04 lorenz <[email protected]>
swig: swig4 needs "stdint.i" to be included (PR #153)
2019-10-02 Reini Urban <[email protected]>
dxf: encode all r2007+ strings as utf-8
see e.g. GH #109 and #143
dxf-check: we start with dxf not dwg
dynapi: add dxf for VISUALSTYLE.unknown_float45
even if unused in DWG
indxf: add_LTYPE_dashes
spec: restrict POLYLINE_MESH to max 100000 vertices
alloc failure with 32bit fuzzing there
dwg2SVG: ignore empty pspaces
We also assume all refs are resolved already.
Fixes GH #109
decode: fix more -Wsign-compare
and -Wtype-limits
decode: fix a -Wsign-compare
fuzz: skip corrupt classes
avoid strcmp on NULL
fuzz: fail on corrupt es.fields.address
protect from overflow segv, found via fuzzing.
Turn asserts into an error
fuzz: more section repair protection
segv on i = 0 with [i - 1]
2019-10-02 Reini Urban <[email protected]>
fuzz: protect from dat overflow
ERROR: bit_read_RC buffer overflow at 18446744073709549374
bits.c:103:14: runtime error: addition of unsigned offset to 0x7ff41c4a9800 overflowed
undefined-behavior
dont advance already overflowed pointer
2019-10-02 Reini Urban <[email protected]>
decode: fix NULL strcmp
found via fuzzing, with corrupt input
decode: fix double-free
with corrupt compressed sections.
Found via fuzzing
fixup htmlescape in src/out_json.h
this is not library specific, just for helper programs.
moved to programs/escape.h
2019-10-01 Reini Urban <[email protected]>
new programs/escape.c,h
extract from out_json, because we dont want
to add these to the API
2019-10-01 Reini Urban <[email protected]>
dwg2SVG: htmlescape strings and names
and for widestrings escape to hex.
Also protect from a few NULL strings.
Closes GH #149
2019-10-01 Reini Urban <[email protected]>
spec: splice TABLECONTENT into TABLE r2010+
as macro, not to duplicate it.
spec: merge TABLECONTENT into TABLE r2010+
a call will not work. TABLECONTENT is only an object, not an entity
and has totally different offsets.
Either put it into a macro or duplicate it.
2019-10-01 Reini Urban <[email protected]>
indxf: resolve_postponed_object_refs
some TABLE/BLOCK/OBJECT field handles neeed to be resolved
at the end, when the blocks and tables are all read.
e.g. INSERT.block_header and various layer or other entity names
Fixes GH #150, INSERT.block_header missing
2019-10-01 Reini Urban <[email protected]>
encode: fix VPORT.VIEWMODE
bit_write_4BITS was broken, and the indxf calculation was missing.
simplify the 4BITS reader and writer, add proper bit logging.
indxf: set UCSFOLLOW and VIEWMODE
2019-10-01 Reini Urban <[email protected]>
decode: better pt logging
print the proper point types, not just RD or BD
indxf: fix VPORT.aspect_ratio
r13+ aspect_ratio is calculated, the internal field
really is VPORT.viewwidth. added to the API.
calculate both.
indxf: more default points values
e.g. VPORT.view_target.z (GH #150)
2019-09-30 Reini Urban <[email protected]>
indxf: fix default points values
e.g. WIPEOUT.uvec (GH #150)
indxf: IMAGE,WIPEOUT.imagedefreactor is code 3
not 5.
2019-09-30 Reini Urban <[email protected]>
change DIMASSOC, indxf: add_DIMASSOC
change the spec a bit.
H 331 seems to be repeated with main_subent_type 73,
H 332 with intsect_subent_type 74
The other handles seem to be superfluous.
Change the order of order of some fields to allow proper dxf
roundtrips.
(just rotated_type fails still)
Only the indices with the bit set in associativity are filled. (no change)
2019-09-30 Reini Urban <[email protected]>
indxf: add_PERSSUBENTMANAGER, add_ASSOCDEPENDENCY
but some of them are not yet encoded.
encode: implement encode_3dsolid
for most cases no encryption needed.
decode has it already, indxf also
indxf: add postprocess_TEXTlike and MTEXT defaults
to minimize defaults to dataflags,
and set default style handle.
2019-09-29 Reini Urban <[email protected]>
json: work on TABLE segv
when it errored on decode TABLE after num_owned.
Don't decode a r2010+ TABLE/CONTENT object header twice, only
process the fields, because it's an entity afterall, not an object.
But now we need to share the struct fields somehow.
2019-09-29 Reini Urban <[email protected]>
indxf: add_TABLESTYLE
for the subfields.
We need a seperate Dwg_TABELSTYLE_border from Dwg_BorderStyle
because of two major differences: BL visible vs B invisible, and
BL vs BS linewt.
2019-09-29 Reini Urban <[email protected]>
harmonize REPEAT names
_ adds idx
C does no checks
N does constant times (else _obj->times)
(and cannot reset times to 0 on error)
F does not calloc/free
spec: VALUEOUTOFBOUNDS TABLEGEOMETRY cell.num_geom_data
as it happens in example_r13.dwg
more DEBUG: unstable TABLESTYLE
promote TABLESTYLE from debugging-only to unstable (just r2010+ is unhandled).
2019-09-28 Reini Urban <[email protected]>
more DEBUG: check CELLSTYLEMAP overflow
samples with too small CELLSTYLEMAP survive now roundtrips.
fix MATERIAL color types
decode: check for bits string overflows
encode: better point logging
indxf: fix new_LWPOLYLINE
no bulges unless needed.
properly encode flags from dxf, honor defaults.
e.g. no const_width if 0.0.
2019-09-28 Reini Urban <[email protected]>
spec: add TABLESTYLE
at least until r2010.
reformat wrong dwg_api.
also fix a few minor ASSOCACTION decl problems.
2019-09-27 Reini Urban <[email protected]>
DOCUMENTOPTIONS is alias for CSACDOCUMENTOPTIONS
dxf, log: shorter make
2019-09-27 Reini Urban <[email protected]>
encode: fix entity bitsize calculation
set START_HANDLE_STREAM for entities in COMMON_ENTITY_HANDLE_DATA.
Fixes GH #142, the very first version which imports most entities.
2019-09-27 Reini Urban <[email protected]>
indxf: comments, logging only
dxf-check for 2000/TS1
use the proper basename
indxf: encode OLE2FRAME.data 310
2019-09-27 Reini Urban <[email protected]>
indxf: fix new_MLINESTYLE_lines
forgot to set MLINESTYLE.num_lines
also improve some obj->type checks. by int, not by name
2019-09-27 Reini Urban <[email protected]>
api: add dwg_find_dicthandle
fixes dwg_find_tablehandle for dicts.
We need to search for the name in the dict given by the first NOD search.
Not just returning this dict. With MLSTYLE we need to return the
MLINESTYLE object ref.
Also use the absolute refs, even if dict handles are code 2, not 4.
2019-09-27 Reini Urban <[email protected]>
indxf: cosmetics only
HEADER.CMLSTYLE is still pointing to the wrong
MLEADERSTYLE object, not MLINESTYLE.
decode: more stable eed decoder
with overflow, e.g. when dat does not advance error earlier.
avoid endless loops on eed decoding errors.
indxf: more eed size fixes
the final string \0 does not count. It is just allocated
for better logging.
indxf: add DIMSTYLE defaults
2019-09-27 Reini Urban <[email protected]>
indxf: fix LAYOUT subclass conflicts
groups 70 and 1 are in both subclasses.
rename two LAYOUT fields:
pspace_block_record => block_header,
last_viewport => active_viewport.
fix setting mspace_block_header and active_viewport from dxf.
2019-09-26 Reini Urban <[email protected]>
log BLOCK_HEADER.num_inserts
for de,encode consistently
indxf: fix BLOCK_HEADER first|last_entity to abs
Fixes Reading handle 1F object type AcDbBlockTableRecord
Error 34 (eWrongObjectType) Object discarded
indxf: nolinks = 0 for BLOCK
always add r2000 prev_entity + next_entity BLOCK, even
if 0
decode eed: fix data decoding
dont jump to a wrong end pos
encode eed: no codepage r2007+
and add a bunch of LOG_POS dat->byte locations for debugging.
indxf: collect eed sizes
only add a new EED size block with a new handle.
else add size to previous block
encode: fix encode_eed
always write the handle after each new sized data block.
not just the first
add dwg_find_tablehandle_silent
and use it in in_dxf.
not exported for now.
encode: fix -Wtautological-constant-out-of-range-compare
warnings. case size to long to compare same types
doc: fix ENTITIES summary line
doc: add Structures for EED and XDATA.
Maybe more special structs later
indxf: add postprocess_BLOCK_HEADER
Closes GH #146
encode: - logging prefix
for patched sizes
2019-09-25 Reini Urban <[email protected]>
indxf: more abs/rel ownerhandle logic
dwg_add_handleref: when searching for existing refs,
DICTIONARY, XRECORD or class may need to be relative.
skip the search for existing absolute ref then.
< GROUP needs to be abs, MLINESTYLE e.g. not, is rel.
2019-09-25 Reini Urban <[email protected]>
indxf: resolve class types earlier
via dwg_encode_get_class, from encode.
improve the abs/rel ownerhandle logic for DICTIONARY and XRECORD
sample_2000.dxf: add THUMBNAILIMAGE section
2019-09-24 Reini Urban <[email protected]>
indxf: ownerhandle abs logic
abs for all old-style types < 500
rel for all classes
WIP dwg_encode_get_class
indxf: WIP skip eed[0].size for handles
still wrong though
indxf: preserve eed[0] handle
and size.
handle is unfortunately stored at eed[0], and was
cleared by the first non-handle value at eed[0].
indxf: no SEQEND nor ENDBLK prev entities
indxf: no 2x XRECORD.ownerhandle
xdata then
encode: prefer class->number over old type
When a class with the same type exists, such as
ACDBPLACEHOLDER or OLE2FRAME, prefer the varies type (>500),
over the fixed type.
Fixes Error 34 (eWrongObjectType)
indxf: better entity defaults
entities bordering to SEQEND, ENDBLK have nolinks.
set ltype defaults
indxf: fixup BLOCK_CONTROL[0].entries[0]
wrong num_entries
indxf: flip logging type code
indxf: fix duplicate handle for BLOCK_HEADER.*Model_Space
it is allocated at objid 0 for minimal DXFs. Reuse the pre-allocated
object then.
2019-09-23 Reini Urban <[email protected]>
dxf: fix wrong INSERT.block_header 2 (name)
Thanks to @soundd1 detecting this bug.
Closes GH #143
dxf: fix wrong COLOR.byblock GH #143
index 256 == bylayer
index 0 == byblock
skip bylayer for dxf, and index & 255 turned bylayer into byblock.
Thanks to @soundd1 detecting this bug
decode: try to repair the section_info_id WIP
See GH #144
2019-09-23 Reini Urban <[email protected]>
WIP decode: more r2004 section map checks
try to fix GH #144.
allow negative Dwg_Section.size ??
ignore overlarge Section id > last_section_id.
added various consistency checks and a section_map_address repair.
2019-09-23 Reini Urban <[email protected]>
json: no 0x%x numeric formats
they cannot be parsed
api: change Dwg_Section address to uint64_t
It is read as such. see GH #144 for a testcase
dwgwrite: fix -y overwrite
write the dwg then
alive.test: timeout 10s
fails on my mac air with asan and 2 larger dwgs, example_2013
and example2018 with dxf2dwg
indxf: set entities entmode
2 for mspace (default)
indxf: set entity codes 6, 390, 347
BB ltype_flags, plotstyle_flags, material_flags
2019-09-22 Reini Urban <[email protected]>
indxf: fix init of points
with extrusion setting pt.z to 1.0, i.e. LINE start.z
indxf: fix EED for points and handle
add proper logging
indxf: but leave room for one active entry
indxf: fixup entries vs num_entries
no NULL entries[] allowed. esp. VIEW_CONTROL entries
are mostly NULL.
encode LTYPE.strings_area if empty
All TF, TFF strings must be dumped, even if NULL.
Fixes Reading handle 14 object type AcDbLinetypeTableRecord
Error 67 (eDwgObjectImproperlyRead) Object discarded
encode: no NULL handles, always with code
Fixes Recover: error eWrongObjectType reading Header.
spec: fixup LTYPE_CONTROL.bylayer and byblock
mixed up.
2019-09-22 Reini Urban <[email protected]>
indxf: fixup HEADER.CMLSTYLE
MLINESTYLE, not MLEADERSTYLE.
Also don't change existing ref.code to 5, recreate if not 5 already
2019-09-22 Reini Urban <[email protected]>
indxf: fixup HEADER.HANDSEED->code = 0
indxf: no NULL ownerhandle, 4.0.0 then
encode all ownerhandles. do relative offsets only for valid absref
targets.
indxf: encode HEADER.FLAGS and CELWEIGHT
add reverse dxf_revcvt_lweight(), add more HEADER defaults
which dont appear in most DXFs
2019-09-21 Reini Urban <[email protected]>
silence FIELD_HANDLE names
add 2 new API funcs: dwg_ref_object_silent,
dwg_resolve_handle_silent (was static)
2019-09-20 Reini Urban <[email protected]>
dxf: fix xdata 3DPOINT DXF
fixes XRECORD:
10 group not followed by 20 group
dxf: fix DICTIONARY bug
with dupl. itemhandles
dxf: skip dupl. 330 ownerhandle
already via common_entity_handle_data now
2019-09-20 Reini Urban <[email protected]>
decode: log bwd handleref names
to log fwd handles we would need to scan all object
types in advance, and then a 2nd time for its fields
This might catch at least some wrong H refs.
2019-09-20 Reini Urban <[email protected]>
decode: macro aesthetics
shorten a few vars. add clang-format directives
example_2000.dxf: add THUMBNAILIMAGE
to have closer numbers in the generated DWG
dxf: ATTDEF.prompt 3 is DXF mandatory
not just SINCE (R_2010)
2019-09-19 Reini Urban <[email protected]>
abstract set_handle_size
for longer handles
indxf: reactors[] always absolute,
but the others, esp. ownrhandle always relative
XRECORD logging spec
free aesthetics
2019-09-19 Reini Urban <[email protected]>
GH #85: COMMON_ENTITY_HANDLE_DATA earlier
Since r2007 we have a seperate hdl stream, which we can call at the
beginning already.
This enables the removal of the extra handles loops in the spec.
But just r2007+, before those handles are still after the normal
fields. Needs a special free logic there, not to delete ctx.leaders
before the 2nd loop.
free: combine common_entity_data with common_entity_handle_data,
just call them in series.
2019-09-19 Reini Urban <[email protected]>
fix MULTILEADER leak
in 2nd REPEAT loop for the handles, when
the leaders field was already removed by the 1st loop.
This will be properly fixed later, when we seperate the
hdl_dat stream earlier from the obj stream, to process both at once.
The text stream str_dat also. See GH #85, branch work/gh85-common
2019-09-18 Reini Urban <[email protected]>
encode: set xdicobjhandle to (3.0.0) not NULL
when empty on r13-r2000
decode refs not as NULL handle
To store the original handle.code on encode.
more logging aesthetics
dwg_bmp: better BMP offset logging
decode: fix FIELD_RSx logging
encode: fixup type with dwg_encode_variable_type
need the proper class id.
Fixes ACAD eNoClassId and eWrongObjectType
decode preR13: strncpy overflow
tbl->name has only 64 byte
fix dwgrewrite leaks
encode: Thumbnail even with empty HEADER.thumbnail_address
The address may be computed.
parse the thumbnail data
mostly for logging
dwgrewrite: overwrite existing -rewrite.dwg
log more types
each read and write should be logged ideally.
not yet for eed, xdata, sentinels, class.
2019-09-17 Reini Urban <[email protected]>
indxf HEADER strings
they disappeared in encode FIELD_TV
with IF_ENCODE_FROM_EARLIER.
indxf: log HEADER dxf codes also.
2019-09-17 Reini Urban <[email protected]>
add proper FORMAT_RLx ditto
add RSx type
encode header: set is_maint defaults
decode: Clearer Handles logging
encode: fix Handles CRC_LE
The little-endian variant, not BE.
indxf: reformat prev.
indxf: dwg_find_tablehandle is already case-insensitive
since 7222ec07edb48ab298a3d90f66f5bcb23c1ef245
indxf: seperate LTYPE bylayer/byblock
into its own fields in LTYPE_CONTROL. Like with BLOCK_CONTROL
model/paper_space before
encode: fix bitsize calculation
indxf: set tablerecord->xrefref = 1 as default
encode: fix object CRC
fix bitsize_pos logging,
fix object address for the size calculation (dxf only).
2019-09-16 Reini Urban <[email protected]>
log the CRC sizes also
encode: fix bit_write_CRC logging
off-by-2
dxf: add dxf-check
similar to dxf-roundtrip.sh via TeighaFileConverter, but
the other way round, for dxf2dwg.
indxf: seperate {model,paper}_space into its own fields
set the proper BLOCK_CONTROL fields.
encode: fixup encode_patch_RLsize
the size doesn't contain itself.
indx: set klass->number, fixup ACDBDATATABLE
in DXF DATATABLE is ACDBDATATABLE, in DWG not.
fixup dwg->num_classes, to fix writing the last class.
indxf: fix HEADER points
and add some more defaults
dxf: add all the missing codepages
and its names
2019-09-15 Reini Urban <[email protected]>
dwg_find_tablehandle: find in DICTIONARY
when the ctrl object is a DICTIONARY. Finds HEADER.CMLSTYLE
indxf: find more HEADER DICTIONARYs
LAYOUT, PLOTSETTINGS, PLOTSTYLENAME, ... with an ACAD_ prefix
in the NOD
indxf: resolve more header handles
resolve_postponed_header_refs also had a bug.
search names case-insensitive.
need DICTIONARY objects for CMLSTYLE.
indxf: add IF_ENCODE_FROM_EARLIER_OR_DXF
set dwg->opts 0x20 on indxf, and 0x30 on minimal DXF,
to set defaults which are not defined in a DXF
decode: fix FIELD_NUM_INSERTS
when num_inserts RC > 1, let it count.
fixes GH #44 to accept one inserts[vcount][0] entity.
compared to gh44-error.dxf: there's only on num_inserts BLKREF there, so
it looks correct now.
encode: better minimal DXF support
set dat->from_version lower to trigger IF_ENCODE_FROM_EARLIER defaults.
set empty header.dwg_version, app_dwg_version, codepage, and
empty HANDSEED.
skip AuxHeader then.
2019-09-15 Reini Urban <[email protected]>
dynapi: BE is a 3DPOINT also
It could be renamed to 3BE, but that would change the API too much.
This fixes heap-overflows when importing r12 DXFs, on the first 210 line.
2019-09-14 Reini Urban <[email protected]>
api: change handle sizes to long
support handle sizes > 4, up to 8 byte on 64bit.
as demonstrated in GH #143 they can be as large as D485E5D6 or even
FD485E65F.
Fixes GH #143
rename SECTION_OBJECTS_R13 => SECTION_HANDLES_R13
and dont recover offsets for illegal handleoff values yet
2019-09-14 Reini Urban <[email protected]>
decode: recover from invalid HANDLES
either wrong handleoff UMC or offset [MC], which come in pairs.
default to the next objects then.
See testcase in GH #143.
set r2000 section names (for logging).
2019-09-14 Reini Urban <[email protected]>
bit_read_UMC: default illegal handleoff to 1
not 0, and the offset from the previous size, to read the next
object.
But the root problem remains in bit_read_UMC. See testcase in GH #143
free: fix double-free of late added refs
They were added by dxf_block_write - get_last_owned_block.
This added endblk_entity is not a new ref, it already exists.
It get's freed by dwg_free.
free: advoid wrong warnings
and skip bounds check exits. we want to free all fields
common.h: fix memBEGIN, unused
because broken
move rad2deg to common.h
define only at one place, not 3
memmem not used anymore
was replaced by membits
build-aux/clang-format-all
2019-09-13 Reini Urban <[email protected]>
indxf: ENDBLK,SEQEND NULL prev_entity,next_entity
See GH #142
indxf: default color.index = 256 ByLayer
and log CMC
spec: reformat XRECORD
misleading identation
encode: xdata forgot the type RS
encode: log more fields
2019-09-13 Reini Urban <[email protected]>
encode/indxf: NULL HANDLE is NULL
and not a ref to 0.
harmonize logging of it.
2019-09-13 Reini Urban <[email protected]>
indxf: reverse XRECORD.xdata order
push to end of list, not front
encode: log XRECORD xdata
2019-09-12 Reini Urban <[email protected]>
dynapi: regen doc
spec: many more VALUEOUTOFBOUNDS checks
and esp. reset the wrong num_ fields.
indxf: set prev_entity, next_entity
now common_entity_handle_data is complete
2019-09-12 Reini Urban <[email protected]>
fix -Wnull-dereference, add SAFEDXFNAME
e.g. when logging HEADER or SUMMARY there is no obj.
also for r2007 strings, there is no obj->has_strings there
Only detected by gcc -O2.
2019-09-12 Reini Urban <[email protected]>
indxf: reset entmode for each block
otherwise all ents end up in Paperspace.
unify object-map logging
log the Handleoff properly
encode: fix the Object-Map
Handleoff is the offset from the previous handle, default: 1,
the next handle. With deleted objects there are holes.
Use the proper types: UMC (unsigned) and MC.
encode: rename loop indices to i
2019-09-11 Reini Urban <[email protected]>
encode: fix omap sorting
use a proper insertion sort, add an init pass
indxf: init BLOCK_HEADER *Model_Space .1F
log: print section addresses as decimal, not hex
encode: add AuxHeader, minor improvements
abstract encode_patch_RLsize(),
add auxheader defaults
fix header.section[0].size calculation (not in dwg_encode_header_variables)
indxf: calc. XRECORD.num_databytes
acad complained about missing XRECORD data:
Error 151 (eOutOfRange) Object discarded
2019-09-10 Reini Urban <[email protected]>
dxf2dwg: overwrite existing files
-Wincompatible-pointer-types-discards-qualifiers
indxf: resolve_objectrefs
the object_map handles.
TODO There are still many holes and duplicates in there
improve dwg_model_space_object
and fail when it fails, mostly with dxf2dwg dwgs
dxf: write to versioned dwgs
2019-09-10 Reini Urban <[email protected]>
indxf: pass dxfname through
so we don't need to resolve klassnames later.
This dxfname is from the 0 NAME section in the dxf.
Also update dxfb_blocks_read from ascii
2019-09-10 Reini Urban <[email protected]>
encode: support dwg_encode_get_class aliases
though it's still very stupid to do it twice.
classes.inc should be enough for a linear search for dxfnames.
set the proper obj->dxfname.
Avoid writing to dat->chain[0] on empty obj->bitsize_pos
2019-09-10 Reini Urban <[email protected]>
encode: fixup padded obj->size
Fixes off-by-one Wrong object size warnings
encode: no 2x object CRC, add asserts
TODO: someone is still writing to dat->chain[0]
2019-09-10 Reini Urban <[email protected]>
restrict OFFSETOBJHANDLE code to 4
create relative offsets only for code 4.
support code 10 and 12 with offsets < 256, size 1.
2019-09-10 Reini Urban <[email protected]>
encode: minor improvements
avoid wrong Expected a CODE 3 handle, got a 6
warnings. Allow relativ offsets (TODO: only 4)
2019-09-10 Reini Urban <[email protected]>
indxf: read BLOCKS
The previous TABLES section already has the BLOCK_HEADER.entries.
Link it to the block_entity, endblk_entity, first_entity,
last_entity.
Set entmode (mspace, pspace) for all the block entities.
Fix dwg_ref_object for relative refs, when ref->absolute_ref is known.
Fix dwg_ref_object to don't set ref->obj on dirty_refs (as in the importer).
Closes GH #133
2019-09-10 Reini Urban <[email protected]>
indxf: fix Invalid entity type BLOCK_HEADER, wanted BLOCK_RECORD
dxf calls the BLOCK_HEADER BLOCK_RECORD. use the proper obj->name
in {BLKREFS
dxf: minor POLYLINE/VERTEX field fixups
add COMMON_ENTITY_POLYLINE.has_vertex 66,
add VERTEX_PFACE_FACE.flag 70,
print and accept more DXF POLYLINE_* elevation points.
indxf: search SEQEND.owner with <r13
but dont store the list of handles there
2019-09-09 Reini Urban <[email protected]>
indxf: fix postprocess SEQEND
was pretty broken.
Closes GH #138
indxf: store owner handle in map
which fixes postprocess_SEQEND, because we can now
find the owner
indxf: fix num_reactors
improve add NULL handleref
always set xdic_missing_flag
indxf: set NULL xdicobjhandle for r2000
indxf: set xdic_missing_flag needed to avoid accessing the NULL xdicobjhandle
encode: add 2013+ has_ds_binary_data
yet unused.
set calc. bitsize
2019-09-09 Reini Urban <[email protected]>
indxf: postprocess SEQEND
and its owner. set the owned[] handles.
Fix setting ownerhandle, reactors and xdicobjhandle
for entities.
See GH #138
WIP owner->ownerhandle
2019-09-09 Reini Urban <[email protected]>
preview is embedded in sentinels
dwgbmp: support optional 2nd arg bmpfile
as documented
dwgbmp: fix for 64bit
on 64bit long is wrong, need BITCODE_RL sizes.
decode Preview section to dwg->thumbnail
with some consistency checks (failing still).
This enables dwgbmp for all 2004+ dwgs.
2004+ resort sections: classes before handles,
and summary after header.
similar to 2000
free DICTIONARY FIELD_VECTOR_T aesthetics only
2019-09-09 Reini Urban <[email protected]>
fix obj_handle_stream and VECTOR_CHKCOUNT
the streams are already restricted from 0 to size, independent of
obj->address.
pass the right stream to AVAIL_BITS.
Fixes many overflow checks, esp. GH #132 08.dwg
2019-09-09 Reini Urban <[email protected]>
read_2004_section_handles: fix oldpos
wrong check. we advance hdl_dat.byte for the handles, not dat.
also check GROUP.num_groups overflow (#132 08.dwg)
2019-09-09 Reini Urban <[email protected]>
decode: fix R2004_section_map int overflow
causing bytes_remaining switch from +8 to -8 but unsigned.
Fixes the crash from #132 with 00.dwg
Closes #93
needs int64_t, but we already required that earlier (RLL, BLL types, ...)
2019-09-08 Reini Urban <[email protected]>
probe for broken restrict
new AX_RESTRICT probe.
rust reports gcc broken from 5 - 10, but I can only confirm
clang 6-8 failing. gcc should not be used since 9 for other reasons.