issue_owner_repo
listlengths 2
2
| issue_body
stringlengths 0
261k
⌀ | issue_title
stringlengths 1
925
| issue_comments_url
stringlengths 56
81
| issue_comments_count
int64 0
2.5k
| issue_created_at
stringlengths 20
20
| issue_updated_at
stringlengths 20
20
| issue_html_url
stringlengths 37
62
| issue_github_id
int64 387k
2.46B
| issue_number
int64 1
127k
|
---|---|---|---|---|---|---|---|---|---|
[
"LibreDWG",
"libredwg"
]
|
The handles for lines in the MLINESTYLE need to be read from the handles stream.
For the MLINESTYLE object, comment out:
SINCE(R_2018)
{
SUB_FIELD_HANDLE (lines[rcount1], ltype, 5, 6);
}
And add
SINCE(R_2018)
{
_REPEAT_N(_obj->num_lines, lines, Dwg_MLINESTYLE_line, 1)
REPEAT_BLOCK
SUB_FIELD_HANDLE (lines[rcount1], ltype, 5, 6);
END_REPEAT_BLOCK
}
just before the DWG_OBJECT_END.
The attached file contains a sample
[ACI 20160321 A 30 east-2018_dwg_version.zip](https://github.com/LibreDWG/libredwg/files/3358991/ACI.20160321.A.30.east-2018_dwg_version.zip)
| Invalid MLINESTYLE in R_2018 | https://api.github.com/repos/LibreDWG/libredwg/issues/116/comments | 0 | 2019-07-04T11:06:12Z | 2019-07-07T10:52:32Z | https://github.com/LibreDWG/libredwg/issues/116 | 464,206,716 | 116 |
[
"LibreDWG",
"libredwg"
]
| Hi,
The following objects all have one or more handles decoded inside a 'UNTIL (R_2007)' if statement. The attached file is from R_2018 but these handles exist. So should the 'UNTIL' check be removed. (There is no mention of version checking in the ODA technical spec).
Note that I am testing on a version where I made the changes described in #112
DIMENSION_ORDINATE
DIMENSION_LINEAR
DIMENSION_ALIGNED
DIMENSION_ANG3PT
DIMENSION_ANG2LN
DIMENSION_RADIUS
DIMENSION_DIAMETER
MTEXT
BLOCK_CONTROL
STYLE
SORTENTSTABLE
[ACI 20160321 A 30 east-2018_dwg_version.zip](https://github.com/LibreDWG/libredwg/files/3358753/ACI.20160321.A.30.east-2018_dwg_version.zip)
| Incorrect version check on several entities | https://api.github.com/repos/LibreDWG/libredwg/issues/115/comments | 0 | 2019-07-04T09:45:09Z | 2019-07-07T10:59:49Z | https://github.com/LibreDWG/libredwg/issues/115 | 464,171,357 | 115 |
[
"LibreDWG",
"libredwg"
]
| Hi,
There should be a START_HANDLE_STREAM; before handle reading in the DICTIONARYVAR object.
...
START_HANDLE_STREAM;
FIELD_HANDLE (ownerhandle, 4, 0);
REACTORS(4);
…
Other potential places where this is missing are (I had no files suitable for testing):
APPID (it has been commented out)
VPORT_ENTITY_HEADER
| Missing START_HANDLE_STREAM | https://api.github.com/repos/LibreDWG/libredwg/issues/114/comments | 1 | 2019-07-04T07:54:30Z | 2019-07-07T10:59:16Z | https://github.com/LibreDWG/libredwg/issues/114 | 464,119,817 | 114 |
[
"LibreDWG",
"libredwg"
]
| The MULTILEADER will create access violation when freeing object if 'ctx.has_content_block' is set since it will always free the ctx.content.txt.style handle (which is a union with ctx.content.blk).
The fix is (in dwg.spec):
1) Comment out the line (all handles are read from the handle stream):
FIELD_HANDLE (ctx.content.blk.block_table, 4, 341);
2) Change the line:
FIELD_HANDLE (ctx.content.txt.style, 5, 340);
to
if (FIELD_VALUE (ctx.has_content)) {
FIELD_HANDLE (ctx.content.txt.style, 5, 340);
} else if (FIELD_VALUE (ctx.has_content_block)) {
FIELD_HANDLE (ctx.content.blk.block_table, 4, 341);
}
The attached file has a multileader with a block content
[ACI 20160321 A 30 east.zip]
(https://github.com/LibreDWG/libredwg/files/3356330/ACI.20160321.A.30.east.zip)
| Access violation when freeing MULTILEADER | https://api.github.com/repos/LibreDWG/libredwg/issues/113/comments | 0 | 2019-07-03T18:15:32Z | 2019-07-07T10:31:20Z | https://github.com/LibreDWG/libredwg/issues/113 | 463,890,363 | 113 |
[
"LibreDWG",
"libredwg"
]
| It looks like setting 'obj->address' is wrong for R_2010+ files. The data read for 'handlestream_size' in R_2010+ files should not be counted in the object size.
Currently in decode.c:
obj->address = dat->byte;
end_address = obj->address + obj->size; /* (calculate the bitsize) */
SINCE (R_2010)
{
obj->handlestream_size = bit_read_UMC (dat);
LOG_INFO (", Hdlsize: " FORMAT_UMC, obj->handlestream_size);
obj->bitsize = obj->size * 8 - obj->handlestream_size;
obj->type = bit_read_BOT (dat);
}
else { obj->type = bit_read_BS (dat); }
Should be changed to:
SINCE (R_2010)
{
/* This is not counted in the object size */
obj->handlestream_size = bit_read_UMC (dat);
LOG_INFO (", Hdlsize: " FORMAT_UMC, obj->handlestream_size);
obj->bitsize = obj->size * 8 - obj->handlestream_size;
}
obj->address = dat->byte;
end_address = obj->address + obj->size; /* (calculate the bitsize) */
SINCE (R_2010)
{
obj->type = bit_read_BOT (dat);
}
else { obj->type = bit_read_BS (dat); }
This however has further knock on effects. It looks like some pieces of code have been modified in order to 'fix' the error.
1) The setting of 'obj->hdlpos' and 'obj->handle_offset' should no longer have '+= 8' in functions dwg_decode_entity() and dwg_decode_object(). (it has already been tagged 'FIXME')
2) The reading of BLOCK_CONTROL in dwg.spec should remove the 'UNTIL (R_2007)'. The paper_space block can always be read.
I.e., change
UNTIL (R_2007) {
FIELD_HANDLE (paper_space, 3, 0);
}
to
FIELD_HANDLE (paper_space, 3, 0);
3) There may be more....
| Incorrect object address set | https://api.github.com/repos/LibreDWG/libredwg/issues/112/comments | 1 | 2019-07-03T18:05:14Z | 2019-07-07T10:59:04Z | https://github.com/LibreDWG/libredwg/issues/112 | 463,886,397 | 112 |
[
"LibreDWG",
"libredwg"
]
| Hi,
It looks like entities are not read correctly when they include a handle to a color. From the DWG technical specification it looks like the handle does not follow the color flags and index. Below is an extract from the spec:
0x4000: has AcDbColor reference (0x8000 is also set in this case).
The handle to the color is written in the handle stream.
It says that the handle is written in the handle stream, not that it follows...
See attached file with a LWPOLYLINE with color handle
[polyline test.zip](https://github.com/LibreDWG/libredwg/files/3349904/polyline.test.zip)
| Invalid reading of enities with AcDbColor handles | https://api.github.com/repos/LibreDWG/libredwg/issues/111/comments | 2 | 2019-07-02T12:01:31Z | 2019-07-06T20:58:34Z | https://github.com/LibreDWG/libredwg/issues/111 | 463,188,776 | 111 |
[
"LibreDWG",
"libredwg"
]
| Hi,
It seems that libreDWG is reading only 4 bytes for type 3/5 EED data. According to the DWG technical specs this data is 8 bytes in size. Below is an extract from the spec.
5 (1005) An entity handle reference. The value is given as 8 bytes -- even if the leading ones are 0. It's not a string; read it as hex, as usual for handles. (There's no length specifier this time.)
See attached file with an MTEXT entity that fails due to this.
[test-abcde.zip](https://github.com/LibreDWG/libredwg/files/3349896/test-abcde.zip)
| Incorrect size when reading EED data type 3/5 | https://api.github.com/repos/LibreDWG/libredwg/issues/110/comments | 0 | 2019-07-02T11:53:45Z | 2019-07-07T08:07:24Z | https://github.com/LibreDWG/libredwg/issues/110 | 463,185,375 | 110 |
[
"LibreDWG",
"libredwg"
]
| Hi,
$ dwg2SVG 1.dwg > 1.svg
Found null object reference. Could not output an SVG symbol for this BLOCK_HEADER
The sample file attached.
[1.zip](https://github.com/LibreDWG/libredwg/files/3303729/1.zip)
Thanks
| Found null object reference. Could not output an SVG symbol for this BLOCK_HEADER | https://api.github.com/repos/LibreDWG/libredwg/issues/109/comments | 4 | 2019-06-18T23:00:31Z | 2019-10-02T09:21:18Z | https://github.com/LibreDWG/libredwg/issues/109 | 457,732,324 | 109 |
[
"LibreDWG",
"libredwg"
]
| trying to parse an normal json file I found nan-values in GEODATAs design_pt, using "NaN" should solve this | json - nan in GEODATA field | https://api.github.com/repos/LibreDWG/libredwg/issues/108/comments | 7 | 2019-05-22T14:20:24Z | 2020-03-20T12:45:21Z | https://github.com/LibreDWG/libredwg/issues/108 | 447,166,109 | 108 |
[
"LibreDWG",
"libredwg"
]
| I found a nullpointer at out_geojson.c line 391
hdr might be NULL, even if error is not set.
My dirty hack was:
`if (!error && hdr && hdr->type == DWG_TYPE_BLOCK_HEADER)`
the problem lies somewhere in dwg_ref_get_object | nullpointer in out_geojson.c | https://api.github.com/repos/LibreDWG/libredwg/issues/107/comments | 3 | 2019-05-22T14:03:01Z | 2019-06-26T06:40:40Z | https://github.com/LibreDWG/libredwg/issues/107 | 447,156,410 | 107 |
[
"LibreDWG",
"libredwg"
]
| ```bash
$ dwg2SVG Drive_shaft.dwg > Drive_shaft.svg
Found null object reference. Could not output an SVG symbol for this BLOCK_HEADER
```
The sample file attached.
[Drive_shaft.dwg.zip](https://github.com/LibreDWG/libredwg/files/3145264/Drive_shaft.dwg.zip)
| Found null object reference. Could not output an SVG symbol for this BLOCK_HEADER | https://api.github.com/repos/LibreDWG/libredwg/issues/106/comments | 1 | 2019-05-05T08:06:57Z | 2019-07-07T18:19:43Z | https://github.com/LibreDWG/libredwg/issues/106 | 440,415,517 | 106 |
[
"LibreDWG",
"libredwg"
]
| There is a null pointer dereference issue in dxf_expect_code function, in_dxf.c file, v0.7.1734
Starting program: /libredwg-0.7.1734/programs/.libs/dxf2dwg -v9 ../test/test-data/crafted.dxf
Reading DXF file ../test/test-data/crafted.dxf
TODO: reading DXF not yet done
dxf{0, SECTION}
ERROR: Invalid DXF group code: 269
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7afd0d3 in dxf_expect_code (dat=0x7fffffffd3c0, pair=0x0, code=2) at in_dxf.c:1088
1088 while (pair->code != code)
(gdb) bt
#0 0x00007ffff7afd0d3 in dxf_expect_code (dat=0x7fffffffd3c0, pair=0x0, code=2) at in_dxf.c:1088
#1 0x00007ffff7b04829 in dwg_read_dxf (dat=0x7fffffffd3c0, dwg=0x7fffffffd4d0) at in_dxf.c:1297
#2 0x00007ffff767f312 in dxf_read_file (filename=0x7fffffffe7fc "../test/test-data/crafted.dxf", dwg=0x7fffffffd4d0) at dwg.c:298
#3 0x0000000000401530 in main (argc=3, argv=0x7fffffffe598) at dxf2dwg.c:225
(gdb) p pair
$1 = (Dxf_Pair * restrict) 0x0
(gdb)
Guoxiang Niu, EaglEye Team | null pointer dereference in in_dxf | https://api.github.com/repos/LibreDWG/libredwg/issues/105/comments | 2 | 2019-04-29T02:38:04Z | 2019-08-06T10:09:56Z | https://github.com/LibreDWG/libredwg/issues/105 | 438,131,288 | 105 |
[
"LibreDWG",
"libredwg"
]
| See testcase #99 [email protected]:2353-32___heap-buffer-overflow
This is a logical realloc mismatch in eed idx vs num_eed, leading to internal malloc corruption. | EED malloc corruption | https://api.github.com/repos/LibreDWG/libredwg/issues/104/comments | 0 | 2019-04-23T05:33:54Z | 2019-04-23T08:59:43Z | https://github.com/LibreDWG/libredwg/issues/104 | 436,006,308 | 104 |
[
"LibreDWG",
"libredwg"
]
| Check which and I'll add them.
I'd really need a list and where in the msys2 paths they are, to be copied into our `bin/` | Missing msys2 DLL's in windows releases | https://api.github.com/repos/LibreDWG/libredwg/issues/103/comments | 2 | 2019-04-19T17:02:03Z | 2019-11-05T14:08:08Z | https://github.com/LibreDWG/libredwg/issues/103 | 435,241,766 | 103 |
[
"LibreDWG",
"libredwg"
]
| dwg2dxf returns "ERROR: Invalid FIELD.childval x 42064384" on a 2010 DWG file. Not sure what this means. | ERROR: Invalid FIELD.childval x 42064384 | https://api.github.com/repos/LibreDWG/libredwg/issues/102/comments | 3 | 2019-04-09T15:53:35Z | 2019-04-26T14:34:04Z | https://github.com/LibreDWG/libredwg/issues/102 | 431,045,190 | 102 |
[
"LibreDWG",
"libredwg"
]
| I am trying to build libredwg with conda-build but this fails due to python linking:
```
ac_python_libdir=$PREFIX/lib/python3.7/config-3.7m-x86_64-linux-gnu
ac_python_library=libpython3.7m.a
ac_python_soname=libpython3.7m.a
use the --enable-frameworked shared library
-L$PREFIX/lib/python3.7/config-3.7m-x86_64-linux-gnu -lpython3.7
checking for Python site-packages path... $PREFIX/lib/python3.7/site-packages
checking python extra libraries... -lpthread -ldl -lutil -lrt
checking python extra linking flags... -Xlinker -export-dynamic
configure: error: in `/opt/conda/conda-bld/libredwg_1553605983551/work':
checking consistency of all components of python development environment... no
configure: error:
Could not link test program to Python. Maybe the main Python library has been
installed in some non-standard library path. If so, pass it to configure,
via the LDFLAGS environment variable.
Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
============================================================================
ERROR!
You probably have to install the development version of the Python package
for your distribution. The exact name of this package varies among them.
============================================================================
```
Setting `LDFLAGS` didn't help either. I wonder what's wrong here. I think conda-build needs static python linking. Maybe this is not supported by libredwg?
| building libredwg with conda fails | https://api.github.com/repos/LibreDWG/libredwg/issues/101/comments | 28 | 2019-03-26T14:03:36Z | 2021-01-31T15:12:47Z | https://github.com/LibreDWG/libredwg/issues/101 | 425,437,733 | 101 |
[
"LibreDWG",
"libredwg"
]
| # libredwg
## version
libredwg 0.7 and 0.7.1645
## description
```txt
libredwg
```
## download link
https://github.com/LibreDWG/libredwg/releases
---------------------
## [email protected]:2034-3___null-pointer-dereference
### description
An issue was discovered in libredwg 0.7 and 0.7.1645, There is a/an null-pointer-dereference in function dwg_dxf_LEADER at dwg.spec:2034-3
### commandline
dwg2dxf @@ -o /dev/null
### source
```c
None
```
### bug report
```txt
AddressSanitizer:DEADLYSIGNAL
=================================================================
==32285==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f4d91d2b51e bp 0x0c22000045e3 sp 0x7ffd87ed4b60 T0)
==32285==The signal is caused by a READ memory access.
==32285==Hint: address points to the zero page.
#0 0x7f4d91d2b51d in dwg_dxf_LEADER /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2034:3
#1 0x7f4d91d2b51d in dwg_dxf_object /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:934
#2 0x7f4d91ca1ba7 in dxf_entities_write /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1528:18
#3 0x7f4d91ca1ba7 in dwg_write_dxf /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1596
#4 0x513785 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:255:56
#5 0x7f4d905aab96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#6 0x41a399 in _start (/home/pwd/git-fuzz/libredwg/libredwg-0.7/installed-asan/bin/dwg2dxf+0x41a399)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2034:3 in dwg_dxf_LEADER
==32285==ABORTING
```
### others
from fuzz project None
crash name None-00000007-1552381583.dwg
Auto-generated by pyspider at 2019-03-12 18:15:41
## bit_read_B@___out-of-bounds-read
### description
An issue was discovered in libredwg 0.7 and 0.7.1645, There is a/an out-of-bounds-read in function bit_read_B at
### commandline
dwg2dxf @@ -o /dev/null
### source
```c
None
```
### bug report
```txt
AddressSanitizer:DEADLYSIGNAL
=================================================================
==32294==ERROR: AddressSanitizer: SEGV on unknown address 0x7f6692681af1 (pc 0x7f6675cd7f01 bp 0x0c0800001814 sp 0x7ffc0f5f3ef0 T0)
==32294==The signal is caused by a READ memory access.
#0 0x7f6675cd7f00 in bit_read_B /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/bits.c
#1 0x7f6675f33256 in obj_string_stream /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode_r2007.c:1126:22
#2 0x7f6675ea3b0f in dwg_decode_object /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2738:18
#3 0x7f6675d81cc6 in dwg_decode_UNKNOWN_OBJ_private /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:5530:1
#4 0x7f6675d81cc6 in dwg_decode_UNKNOWN_OBJ /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:5530
#5 0x7f6675d81cc6 in dwg_decode_add_object /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:3809
#6 0x7f6675d113d9 in read_2004_section_handles /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2100:19
#7 0x7f6675d113d9 in decode_R2004 /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2230
#8 0x7f6675cf4049 in dwg_decode /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c
#9 0x7f6675ccf4b1 in dwg_read_file /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/dwg.c:186:11
#10 0x513411 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:225:15
#11 0x7f6674bacb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#12 0x41a399 in _start (/home/pwd/git-fuzz/libredwg/libredwg-0.7/installed-asan/bin/dwg2dxf+0x41a399)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/bits.c in bit_read_B
==32294==ABORTING
```
### others
from fuzz project None
crash name None-00000006-1552381538.dwg
Auto-generated by pyspider at 2019-03-12 18:15:42
## [email protected]:2353-32___heap-buffer-overflow
### description
An issue was discovered in libredwg 0.7 and 0.7.1645, There is a/an heap-buffer-overflow in function dwg_decode_eed_data at decode.c:2353-32
### commandline
dwg2dxf @@ -o /dev/null
### source
```c
In file: /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c
2348 data->u.eed_4.data[j] = bit_read_RC(dat);
2349 LOG_TRACE("raw: %s\n", data->u.eed_4.data);
2350 break;
2351 case 10: case 11: case 12: case 13: /*case 14: case 15:*/
2352 data->u.eed_10.point.x = bit_read_RD(dat);
► 2353 data->u.eed_10.point.y = bit_read_RD(dat);
2354 data->u.eed_10.point.z = bit_read_RD(dat);
2355 LOG_TRACE("3dpoint: %f, %f, %f\n",
2356 data->u.eed_10.point.x,
2357 data->u.eed_10.point.y,
2358 data->u.eed_10.point.z);
```
### bug report
```txt
=================================================================
==32310==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000006740 at pc 0x7efd7e7806c5 bp 0x7ffe71660c30 sp 0x7ffe71660c28
WRITE of size 8 at 0x602000006740 thread T0
#0 0x7efd7e7806c4 in dwg_decode_eed_data /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2353:32
#1 0x7efd7e7806c4 in dwg_decode_eed /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2473
#2 0x7efd7e7757ce in dwg_decode_entity /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2683:12
#3 0x7efd7e64f874 in dwg_decode_LEADER_private /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2026:1
#4 0x7efd7e64f874 in dwg_decode_LEADER /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2026
#5 0x7efd7e64f874 in dwg_decode_add_object /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:3630
#6 0x7efd7e5fe3d9 in read_2004_section_handles /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2100:19
#7 0x7efd7e5fe3d9 in decode_R2004 /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2230
#8 0x7efd7e5e1049 in dwg_decode /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c
#9 0x7efd7e5bc4b1 in dwg_read_file /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/dwg.c:186:11
#10 0x513411 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:225:15
#11 0x7efd7d499b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#12 0x41a399 in _start (/home/pwd/git-fuzz/libredwg/libredwg-0.7/installed-asan/bin/dwg2dxf+0x41a399)
0x602000006740 is located 5 bytes to the right of 11-byte region [0x602000006730,0x60200000673b)
allocated by thread T0 here:
#0 0x4da478 in calloc /home/pwd/llvm_dev/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:97
#1 0x7efd7e77ea9f in dwg_decode_eed /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2470:47
#2 0x7efd7e7757ce in dwg_decode_entity /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2683:12
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2353:32 in dwg_decode_eed_data
Shadow bytes around the buggy address:
0x0c047fff8c90: fa fa 00 00 fa fa 04 fa fa fa 00 03 fa fa 04 fa
0x0c047fff8ca0: fa fa 00 03 fa fa 00 06 fa fa 00 00 fa fa 00 00
0x0c047fff8cb0: fa fa 00 00 fa fa 00 00 fa fa 04 fa fa fa 00 03
0x0c047fff8cc0: fa fa 04 fa fa fa 00 03 fa fa 00 06 fa fa 00 03
0x0c047fff8cd0: fa fa 00 06 fa fa 00 03 fa fa 00 06 fa fa 00 03
=>0x0c047fff8ce0: fa fa 00 06 fa fa 00 03[fa]fa fa fa fa fa fa fa
0x0c047fff8cf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8d00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8d10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8d20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8d30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==32310==ABORTING
```
### others
from fuzz project None
crash name None-00000003-1552381586.dwg
Auto-generated by pyspider at 2019-03-12 18:15:43
## [email protected]:2523-11___heap-buffer-overflow
### description
An issue was discovered in libredwg 0.7 and 0.7.1645, There is a/an heap-buffer-overflow in function dwg_dxf_LTYPE at dwg.spec:2523-11
### commandline
dwg2dxf @@ -o /dev/null
### source
```c
None
```
### bug report
```txt
=================================================================
==32330==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x608000015008 at pc 0x7eff104ff2d8 bp 0x7ffd1eb7a490 sp 0x7ffd1eb7a488
READ of size 1 at 0x608000015008 thread T0
#0 0x7eff104ff2d7 in dwg_dxf_LTYPE /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2523:11
#1 0x7eff104de5c1 in dxf_tables_write /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1272:11
#2 0x7eff104b01d5 in dwg_write_dxf /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1589:9
#3 0x513785 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:255:56
#4 0x7eff0edb9b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#5 0x41a399 in _start (/home/pwd/git-fuzz/libredwg/libredwg-0.7/installed-asan/bin/dwg2dxf+0x41a399)
0x608000015008 is located 8 bytes to the right of 96-byte region [0x608000014fa0,0x608000015000)
allocated by thread T0 here:
#0 0x4da478 in calloc /home/pwd/llvm_dev/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:97
#1 0x7eff0ff7c742 in dwg_add_LINE /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:877:1
#2 0x7eff0ff7c742 in dwg_decode_LINE /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:877
#3 0x7eff0ff7c742 in dwg_decode_add_object /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:3555
#4 0x7eff0ff1e3d9 in read_2004_section_handles /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2100:19
#5 0x7eff0ff1e3d9 in decode_R2004 /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2230
#6 0x7eff0ff01049 in dwg_decode /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c
#7 0x7eff0fedc4b1 in dwg_read_file /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/dwg.c:186:11
#8 0x513411 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:225:15
#9 0x7eff0edb9b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2523:11 in dwg_dxf_LTYPE
Shadow bytes around the buggy address:
0x0c107fffa9b0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffa9c0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffa9d0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffa9e0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffa9f0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c107fffaa00: fa[fa]fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffaa10: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffaa20: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffaa30: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffaa40: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c107fffaa50: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==32330==ABORTING
```
### others
from fuzz project None
crash name None-00000013-1552381572.dwg
Auto-generated by pyspider at 2019-03-12 18:15:44
## dxf_header_write@header_variables_dxf.spec:73-3___heap-buffer-overflow
### description
An issue was discovered in libredwg 0.7 and 0.7.1645, There is a/an heap-buffer-overflow in function dxf_header_write at header_variables_dxf.spec:73-3
### commandline
dwg2dxf @@ -o /dev/null
### source
```c
None
```
### bug report
```txt
=================================================================
==32334==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000005ae0 at pc 0x7f47f17c85b0 bp 0x7ffdfb1fa790 sp 0x7ffdfb1fa788
READ of size 8 at 0x602000005ae0 thread T0
#0 0x7f47f17c85af in dxf_header_write /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./header_variables_dxf.spec:73:3
#1 0x7f47f179d2c9 in dwg_write_dxf /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1579:3
#2 0x513785 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:255:56
#3 0x7f47f00a7b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#4 0x41a399 in _start (/home/pwd/git-fuzz/libredwg/libredwg-0.7/installed-asan/bin/dwg2dxf+0x41a399)
0x602000005ae0 is located 8 bytes to the right of 8-byte region [0x602000005ad0,0x602000005ad8)
allocated by thread T0 here:
#0 0x4da478 in calloc /home/pwd/llvm_dev/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:97
#1 0x7f47f127cb11 in dwg_add_UNKNOWN_OBJ /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:5530:1
#2 0x7f47f127cb11 in dwg_decode_UNKNOWN_OBJ /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:5530
#3 0x7f47f127cb11 in dwg_decode_add_object /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:3809
#4 0x7f47f120c3d9 in read_2004_section_handles /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2100:19
#5 0x7f47f120c3d9 in decode_R2004 /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2230
#6 0x7f47f11ef049 in dwg_decode /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c
#7 0x7f47f11ca4b1 in dwg_read_file /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/dwg.c:186:11
#8 0x513411 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:225:15
#9 0x7f47f00a7b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./header_variables_dxf.spec:73:3 in dxf_header_write
Shadow bytes around the buggy address:
0x0c047fff8b00: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x0c047fff8b10: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x0c047fff8b20: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x0c047fff8b30: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x0c047fff8b40: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
=>0x0c047fff8b50: fa fa 00 fa fa fa 00 fa fa fa 00 fa[fa]fa 00 fa
0x0c047fff8b60: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x0c047fff8b70: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x0c047fff8b80: fa fa 00 fa fa fa 00 06 fa fa 00 06 fa fa 00 06
0x0c047fff8b90: fa fa 00 06 fa fa 00 06 fa fa 00 06 fa fa 00 06
0x0c047fff8ba0: fa fa 00 06 fa fa 00 06 fa fa 00 06 fa fa 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==32334==ABORTING
```
### others
from fuzz project None
crash name None-00000008-1552381574.dwg
Auto-generated by pyspider at 2019-03-12 18:15:45
## dwg_dxf_LTYPE@___null-pointer-dereference
### description
An issue was discovered in libredwg 0.7 and 0.7.1645, There is a/an null-pointer-dereference in function dwg_dxf_LTYPE at
### commandline
dwg2dxf @@ -o /dev/null
### source
```c
In file: /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/dwg.spec
2482 FIELD_RC (alignment, 72);
2483 }
2484 FIELD_RC (num_dashes, 73);
2485 REPEAT_C(num_dashes, dash, Dwg_LTYPE_dash)
2486 {
► 2487 PRE(R_13)
2488 {
2489 FIELD_RD (dash[rcount1].length, 49);
2490 #ifndef IS_PRINT
2491 FIELD_VALUE(pattern_len) += FIELD_VALUE(dash[rcount1].length);
2492 #endif
```
### bug report
```txt
AddressSanitizer:DEADLYSIGNAL
=================================================================
==32338==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fb4e3e7f99c bp 0x7ffe9fb40000 sp 0x7ffe9fb3ec00 T0)
==32338==The signal is caused by a READ memory access.
==32338==Hint: address points to the zero page.
#0 0x7fb4e3e7f99b in dwg_dxf_LTYPE /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec
#1 0x7fb4e3e61658 in dxf_tables_write /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1275:20
#2 0x7fb4e3e331d5 in dwg_write_dxf /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1589:9
#3 0x513785 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:255:56
#4 0x7fb4e273cb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#5 0x41a399 in _start (/home/pwd/git-fuzz/libredwg/libredwg-0.7/installed-asan/bin/dwg2dxf+0x41a399)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec in dwg_dxf_LTYPE
==32338==ABORTING
```
### others
from fuzz project None
crash name None-00000012-1552381601.dwg
Auto-generated by pyspider at 2019-03-12 18:15:45
## [email protected]:2471-3___null-pointer-dereference
### description
An issue was discovered in libredwg 0.7 and 0.7.1645, There is a/an null-pointer-dereference in function dwg_dxf_LTYPE at dwg.spec:2471-3
### commandline
dwg2dxf @@ -o /dev/null
### source
```c
None
```
### bug report
```txt
AddressSanitizer:DEADLYSIGNAL
=================================================================
==32342==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f7dab4ac4f0 bp 0x3ff0000000000018 sp 0x7fff577b50a0 T0)
==32342==The signal is caused by a READ memory access.
==32342==Hint: address points to the zero page.
#0 0x7f7dab4ac4ef in dwg_dxf_LTYPE /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2471:3
#1 0x7f7dab48f5c1 in dxf_tables_write /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1272:11
#2 0x7f7dab4611d5 in dwg_write_dxf /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1589:9
#3 0x513785 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:255:56
#4 0x7f7da9d6ab96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#5 0x41a399 in _start (/home/pwd/git-fuzz/libredwg/libredwg-0.7/installed-asan/bin/dwg2dxf+0x41a399)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2471:3 in dwg_dxf_LTYPE
==32342==ABORTING
```
### others
from fuzz project None
crash name None-00000010-1552381589.dwg
Auto-generated by pyspider at 2019-03-12 18:15:45
## [email protected]:1323-3___null-pointer-dereference
### description
An issue was discovered in libredwg 0.7 and 0.7.1645, There is a/an null-pointer-dereference in function bit_convert_TU at bits.c:1323-3
### commandline
dwg2dxf @@ -o /dev/null
### source
```c
None
```
### bug report
```txt
AddressSanitizer:DEADLYSIGNAL
=================================================================
==32351==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7feaa5e0727e bp 0x000000000001 sp 0x7fffe83aecc0 T0)
==32351==The signal is caused by a READ memory access.
==32351==Hint: address points to the zero page.
#0 0x7feaa5e0727d in bit_convert_TU /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/bits.c:1323:3
#1 0x7feaa63f0ed0 in dwg_dxf_STYLE /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2425:13
#2 0x7feaa63f0ed0 in dxf_tables_write /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1319
#3 0x7feaa63bc1d5 in dwg_write_dxf /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1589:9
#4 0x513785 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:255:56
#5 0x7feaa4cc5b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#6 0x41a399 in _start (/home/pwd/git-fuzz/libredwg/libredwg-0.7/installed-asan/bin/dwg2dxf+0x41a399)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/bits.c:1323:3 in bit_convert_TU
==32351==ABORTING
```
### others
from fuzz project None
crash name None-00000001-1552381543.dwg
Auto-generated by pyspider at 2019-03-12 18:15:46
## [email protected]:2354-32___heap-buffer-overflow
### description
An issue was discovered in libredwg 0.7 and 0.7.1645, There is a/an heap-buffer-overflow in function dwg_decode_eed_data at decode.c:2354-32
### commandline
dwg2dxf @@ -o /dev/null
### source
```c
In file: /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c
2349 LOG_TRACE("raw: %s\n", data->u.eed_4.data);
2350 break;
2351 case 10: case 11: case 12: case 13: /*case 14: case 15:*/
2352 data->u.eed_10.point.x = bit_read_RD(dat);
2353 data->u.eed_10.point.y = bit_read_RD(dat);
► 2354 data->u.eed_10.point.z = bit_read_RD(dat);
2355 LOG_TRACE("3dpoint: %f, %f, %f\n",
2356 data->u.eed_10.point.x,
2357 data->u.eed_10.point.y,
2358 data->u.eed_10.point.z);
2359 break;
```
### bug report
```txt
=================================================================
==32355==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60300007ff11 at pc 0x7feedd1396cf bp 0x7ffeed7b1e10 sp 0x7ffeed7b1e08
WRITE of size 8 at 0x60300007ff11 thread T0
#0 0x7feedd1396ce in dwg_decode_eed_data /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2354:32
#1 0x7feedd1396ce in dwg_decode_eed /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2473
#2 0x7feedd12e7ce in dwg_decode_entity /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2683:12
#3 0x7feedd008874 in dwg_decode_LEADER_private /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2026:1
#4 0x7feedd008874 in dwg_decode_LEADER /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2026
#5 0x7feedd008874 in dwg_decode_add_object /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:3630
#6 0x7feedcfb73d9 in read_2004_section_handles /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2100:19
#7 0x7feedcfb73d9 in decode_R2004 /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2230
#8 0x7feedcf9a049 in dwg_decode /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c
#9 0x7feedcf754b1 in dwg_read_file /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/dwg.c:186:11
#10 0x513411 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:225:15
#11 0x7feedbe52b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#12 0x41a399 in _start (/home/pwd/git-fuzz/libredwg/libredwg-0.7/installed-asan/bin/dwg2dxf+0x41a399)
0x60300007ff11 is located 0 bytes to the right of 17-byte region [0x60300007ff00,0x60300007ff11)
allocated by thread T0 here:
#0 0x4da478 in calloc /home/pwd/llvm_dev/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:97
#1 0x7feedd137a9f in dwg_decode_eed /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2470:47
#2 0x7feedd12e7ce in dwg_decode_entity /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2683:12
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/decode.c:2354:32 in dwg_decode_eed_data
Shadow bytes around the buggy address:
0x0c0680007f90: fa fa 00 00 00 00 fa fa 00 00 00 00 fa fa 00 00
0x0c0680007fa0: 00 05 fa fa 00 00 00 02 fa fa 00 00 01 fa fa fa
0x0c0680007fb0: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fa
0x0c0680007fc0: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd
0x0c0680007fd0: fd fd fa fa 00 00 00 05 fa fa 00 00 00 02 fa fa
=>0x0c0680007fe0: 00 00[01]fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0680007ff0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0680008000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c0680008010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c0680008020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c0680008030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==32355==ABORTING
```
### others
from fuzz project None
crash name None-00000004-1552381550.dwg
Auto-generated by pyspider at 2019-03-12 18:15:46
## [email protected]:2154-1___out-of-bounds-read
### description
An issue was discovered in libredwg 0.7 and 0.7.1645, There is a/an out-of-bounds-read in function dwg_dxf_BLOCK_CONTROL at dwg.spec:2154-1
### commandline
dwg2dxf @@ -o /dev/null
### source
```c
None
```
### bug report
```txt
AddressSanitizer:DEADLYSIGNAL
=================================================================
==32364==ERROR: AddressSanitizer: SEGV on unknown address 0x00207fff8003 (pc 0x7f4948e0cf48 bp 0x7fffdb01b150 sp 0x7fffdb01aee0 T0)
==32364==The signal is caused by a READ memory access.
#0 0x7f4948e0cf47 in dwg_dxf_BLOCK_CONTROL /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2154:1
#1 0x7f4948e0cf47 in dxf_tables_write /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1421
#2 0x7f4948dce1d5 in dwg_write_dxf /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/out_dxf.c:1589:9
#3 0x513785 in main /home/pwd/git-fuzz/libredwg/libredwg-0.7/programs/dwg2dxf.c:255:56
#4 0x7f49476d7b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#5 0x41a399 in _start (/home/pwd/git-fuzz/libredwg/libredwg-0.7/installed-asan/bin/dwg2dxf+0x41a399)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/pwd/git-fuzz/libredwg/libredwg-0.7/src/./dwg.spec:2154:1 in dwg_dxf_BLOCK_CONTROL
==32364==ABORTING
```
### others
from fuzz project None
crash name None-00000005-1552381649.dwg
Auto-generated by pyspider at 2019-03-12 18:15:47
[dwg2dxf.tar.gz](https://github.com/LibreDWG/libredwg/files/2956421/dwg2dxf.tar.gz)
And a same report send to [savannah.gnu.org/bugs](https://savannah.gnu.org/bugs/index.php?55893) | fuzzing results LibreDWG | https://api.github.com/repos/LibreDWG/libredwg/issues/99/comments | 7 | 2019-03-12T10:51:26Z | 2019-04-24T13:52:34Z | https://github.com/LibreDWG/libredwg/issues/99 | 419,920,036 | 99 |
[
"LibreDWG",
"libredwg"
]
| we cannot use clang to regen dynapi,
we need to use gcc.
Convert::Binary::C comes with it's own very old C89 preprocessor, which doesn't understand many new compiler builtin definitions. It does know #include_next though.
current progress in /usr/lib/llvm-7/lib/clang/7.0.1/include/stddef.h:
```
'__has_feature(x)=0', '__has_include_next(x)=0',
'__INTPTR_TYPE__=long int', '__UINTPTR_TYPE__=unsigned long int',
'__INTMAX_TYPE__=long int', '__UINTMAX_TYPE__=unsigned long int',
'__gwchar_t=int', '_WCHAR_T=int'
``` | clang support for gen-dynapi.pl | https://api.github.com/repos/LibreDWG/libredwg/issues/98/comments | 0 | 2019-02-25T08:40:32Z | 2019-02-25T13:53:51Z | https://github.com/LibreDWG/libredwg/issues/98 | 413,990,003 | 98 |
[
"LibreDWG",
"libredwg"
]
| dwg_ent_text_get_text
dwg_ent_text_get_insertion_point
dwg_ent_text_get_height
dwg_ent_line_get_start_point
dwg_ent_line_get_end_point
dwg_ent_circle_get_center
dwg_ent_circle_get_radius
dwg_ent_arc_get_radius
dwg_ent_arc_get_start_angle
dwg_ent_arc_get_end_angle
dwg_ent_arc_get_center
dwg_ent_insert_get_rotation
dwg_ent_insert_get_ins_pt
dwg_ent_insert_get_scale
dwg_obj_block_header_get_name
| dwg2svg2: switch to dynapi, no deprecated old api functions | https://api.github.com/repos/LibreDWG/libredwg/issues/97/comments | 0 | 2019-02-23T09:53:26Z | 2019-07-19T11:22:17Z | https://github.com/LibreDWG/libredwg/issues/97 | 413,679,029 | 97 |
[
"LibreDWG",
"libredwg"
]
| layer->on always is 0 | can i get layer switch state | https://api.github.com/repos/LibreDWG/libredwg/issues/96/comments | 4 | 2019-02-18T09:31:09Z | 2019-02-21T06:07:59Z | https://github.com/LibreDWG/libredwg/issues/96 | 411,379,373 | 96 |
[
"LibreDWG",
"libredwg"
]
| I convert dwg to GeoJSON using binary 0.7.1600 dwgread.exe.But the output GeoJSON is empty.

| GeoJSON colors how? | https://api.github.com/repos/LibreDWG/libredwg/issues/95/comments | 14 | 2019-02-14T02:01:01Z | 2020-06-23T09:08:59Z | https://github.com/LibreDWG/libredwg/issues/95 | 410,089,974 | 95 |
[
"LibreDWG",
"libredwg"
]
| I would like to thank you for your effort in liberating dwg format. I would like to request a tool to clean dwg files taking this measures:
1- Remove the thumbnails.
2- replace long path with related path.
3- zerofy embedded GUID.
4- Purge unused items.
5- optimize repeated shapes like "blockify" tool in bricscad.
6- optimize embedded files (like wmf, word,..etc) for size and add option to extract them.
7- optimize compressed streams for size.
This is what i have in mind and i hope this is hopeful.
Can this be made for DWF format too. We've managed to reduce its size through "Fileoptimizer" and "Leanify".
Regards
| Request DWGclean | https://api.github.com/repos/LibreDWG/libredwg/issues/94/comments | 2 | 2019-02-06T08:30:52Z | 2019-02-21T09:04:25Z | https://github.com/LibreDWG/libredwg/issues/94 | 407,126,305 | 94 |
[
"LibreDWG",
"libredwg"
]
| read_R2004_section_info has a overflow problem, the 2007 variant read_data_section not
e.g.
```
$ programs/dwgread test/test-big/2004/HARTA_E_PRISHTINES.dwg
Warning: Oops, Section[7] => Section_Info 2111
Warning: Failed to find section_info[13] with type 0x3
ERROR: Failed to read compressed class section
Warning: Failed to find section_info[13] with type 0x1
Warning: Skip empty section 2098 AcDb:AcDbObjects
Warning: Skip empty section 2099 AcDb:AcDbObjects
Warning: Skip empty section 2100 AcDb:AcDbObjects
Warning: Skip empty section 2101 AcDb:AcDbObjects
Warning: Failed to find section_info[13] with type 0x4
```
They were created by AutoCAD and can be opened with AutoCAD.
This was previously hacked around with Oops2, Section[%d] => Section_Info %d"
The root cause is that the section_size is uint64, not int32. (ODA p28) | fail to decode big non-2007 sections | https://api.github.com/repos/LibreDWG/libredwg/issues/93/comments | 2 | 2019-01-31T10:58:57Z | 2019-09-09T08:16:13Z | https://github.com/LibreDWG/libredwg/issues/93 | 405,190,089 | 93 |
[
"LibreDWG",
"libredwg"
]
| needed for in_dxf | dynapi: add a dxfgroup field | https://api.github.com/repos/LibreDWG/libredwg/issues/92/comments | 1 | 2019-01-30T10:17:15Z | 2019-02-05T10:59:24Z | https://github.com/LibreDWG/libredwg/issues/92 | 404,697,538 | 92 |
[
"LibreDWG",
"libredwg"
]
| The following error was encountered while reading
in XRECORD starting at line 7856: (Leader_2007.dxf)
112 group not followed by 122 group
Invalid or incomplete DXF input -- drawing discarded. | dxfin: XRECORD 112 group not followed by 122 group | https://api.github.com/repos/LibreDWG/libredwg/issues/91/comments | 1 | 2019-01-27T16:09:25Z | 2019-01-28T10:32:00Z | https://github.com/LibreDWG/libredwg/issues/91 | 403,566,835 | 91 |
[
"LibreDWG",
"libredwg"
]
| it seems that convert successful:

but when i open dxf using AutoCAD,got an error,nothing inside.

my release version : 0.7.1501 | dxf invalid for r14, AcDbEntity class markers needed | https://api.github.com/repos/LibreDWG/libredwg/issues/90/comments | 6 | 2019-01-24T03:00:53Z | 2019-01-27T16:08:05Z | https://github.com/LibreDWG/libredwg/issues/90 | 402,521,137 | 90 |
[
"LibreDWG",
"libredwg"
]
| dxf-roundtrip: Hatch is gradient, but either solid fill flag not set or pattern type is not pre-defined.
PLANO_MASSANASSA_2004, CascoUrbano_2004
AcDbHatch(140068): Color index 65535 | dxf: gradientfill HATCH | https://api.github.com/repos/LibreDWG/libredwg/issues/89/comments | 1 | 2019-01-08T13:43:37Z | 2019-01-16T14:30:58Z | https://github.com/LibreDWG/libredwg/issues/89 | 396,912,470 | 89 |
[
"LibreDWG",
"libredwg"
]
| process the entities via the handle vector iterators, not via incrementing the hdl. They are out of order.
validate the handle vectors, for off-by-one, types and missing entities (e.g. 2013+ w/ color)
properly handle subentities (attrib, vertex).
skip *Model_Space UNDERLAY entities.
add dwg_obj_is_subentity
pspace entities belong to blocks, into its *Paper_SpaceN block.
rename get_*_owned_object to _entity
get_next_owned_object only returned the next block entity, not any object associated and located in this block, and neither any VERTEX/ATTRIB. esp. since r2004+ with its BLOCK_HEADER.entities array.
add get_last_owned_block(), to return the ENDBLK for a BLOCK_HEADER | dxf: properly split BLOCKS from ENTITIES | https://api.github.com/repos/LibreDWG/libredwg/issues/88/comments | 1 | 2019-01-05T17:26:12Z | 2019-01-09T12:45:21Z | https://github.com/LibreDWG/libredwg/issues/88 | 396,183,730 | 88 |
[
"LibreDWG",
"libredwg"
]
| Would an LGPL license not make this more useful for projects like FreeCAD and LibreCAD? | License | https://api.github.com/repos/LibreDWG/libredwg/issues/87/comments | 2 | 2018-12-28T15:34:44Z | 2019-01-03T10:25:49Z | https://github.com/LibreDWG/libredwg/issues/87 | 394,661,928 | 87 |
[
"LibreDWG",
"libredwg"
]
| not just a swig or python probe. turn it off independently | add --disable-bindings | https://api.github.com/repos/LibreDWG/libredwg/issues/86/comments | 0 | 2018-12-26T13:07:04Z | 2019-01-09T12:45:29Z | https://github.com/LibreDWG/libredwg/issues/86 | 394,164,361 | 86 |
[
"LibreDWG",
"libredwg"
]
| limit the chain offset and size to the actual object sizes during object processing. similar to libdxfrw.
this would simplify calculating the handlestream offset which is still wrong, and catch overflows.
we only do this for string handles, see obj_string_stream(). The handlestream offset was fixed with eac9c890757cc06626f05e733c2bec87581c9c11 for #112
the temp. offset types can also be shorter. now we have to use 64bit offsets, where BITCODE_BL would be enough.
| limit dat/hdl_dat in objects | https://api.github.com/repos/LibreDWG/libredwg/issues/85/comments | 1 | 2018-12-26T10:39:11Z | 2019-07-15T07:17:41Z | https://github.com/LibreDWG/libredwg/issues/85 | 394,139,372 | 85 |
[
"LibreDWG",
"libredwg"
]
| libxml2 is outdated,
py*-lxml is packaged everywhere.
```
-import libxml2
+import lxml
- doc = libxml2.parseFile(ideal)
+ doc = etree.parse(ideal)
- root = doc.getRootElement()
+ root = doc.getroot()
``` | python: replace libxml2 with lxml | https://api.github.com/repos/LibreDWG/libredwg/issues/84/comments | 0 | 2018-12-25T11:38:37Z | 2018-12-25T11:39:02Z | https://github.com/LibreDWG/libredwg/issues/84 | 394,010,553 | 84 |
[
"LibreDWG",
"libredwg"
]
| some dwg's (r2007) have the SEQEND directly following the POLYLINE, before the VERTEXes.
sort it after the VERTEX ents.
Maybe iterate over the handles then, not over the objects. libdxfrw does it this way.
The same happens for INSERT - SEQEND - ATTRIB in example_20*.dwg.
Some r2018 dwg's also have a corrupt first POLYLINE_3D.vertex[0] handle because of #85.
Then unsorted handling might be better. | dxf: sort POLYLINE - SEQEND - VERTEX | https://api.github.com/repos/LibreDWG/libredwg/issues/83/comments | 1 | 2018-12-23T21:52:09Z | 2019-01-09T12:45:36Z | https://github.com/LibreDWG/libredwg/issues/83 | 393,783,012 | 83 |
[
"LibreDWG",
"libredwg"
]
| Most objects (without the control and tables) already decode proper parenthandle fields, but for entities the owner is calculated implicitly.
For some entities with subentities (VERTEX_2D, ATTRIB, ATTDEF) and entities within BLOCK's their owner needs to be calculated and printed on out_dxf.
All other entities are either owned by the MSPACE block_record (the default), or optionally by PSPACE.
We need to track the owner dynamically in decode_entity_TOKEN, to check if subentities follow (has_attrib, vertex ...) or if we are in a block or in pspace.
Also decide on the name, if parent(handle) or owner
----
its confusing both ways. the corresponding object ptr is called parenthandle, but the obj->parent is something else: inheritance.
officially we have hard and soft owners, owning the reference, for liveness on deletion.
in the end it would be just too confusing mixing up the _obj->parent and obj->parent with _ent->parent. | dxf: wrong 330 parent/owner handles | https://api.github.com/repos/LibreDWG/libredwg/issues/82/comments | 2 | 2018-12-20T10:44:51Z | 2019-01-09T12:45:44Z | https://github.com/LibreDWG/libredwg/issues/82 | 392,987,970 | 82 |
[
"LibreDWG",
"libredwg"
]
| only *Paper_Space0 is emitted.
it is properly decoded. | dxf misses PSPACE blocks | https://api.github.com/repos/LibreDWG/libredwg/issues/81/comments | 2 | 2018-12-19T16:20:02Z | 2019-01-09T12:45:51Z | https://github.com/LibreDWG/libredwg/issues/81 | 392,676,443 | 81 |
[
"LibreDWG",
"libredwg"
]
| e.g. with the chinese word for Centerline
"中心线" 0x4e2d 0x5fc3 0x7ebf (chinese: Zhōngxīn xiàn)
=> e4b8ad e5bf83 e7babf
but it is displayed as -ÿ | wrong bit_convert_TU UCS-2 to UTF-8 conversion | https://api.github.com/repos/LibreDWG/libredwg/issues/80/comments | 0 | 2018-12-19T12:56:41Z | 2019-01-09T12:45:58Z | https://github.com/LibreDWG/libredwg/issues/80 | 392,589,846 | 80 |
[
"LibreDWG",
"libredwg"
]
| DXF cannot be imported with the internal lineweight bitcodes (enum's, see acdb.h)
They need to be converted to the 100th mm value or -1 .. -3 for the defaults. | dxf_cvt_lweight | https://api.github.com/repos/LibreDWG/libredwg/issues/79/comments | 0 | 2018-12-18T14:19:16Z | 2019-01-09T12:46:07Z | https://github.com/LibreDWG/libredwg/issues/79 | 392,177,121 | 79 |
[
"LibreDWG",
"libredwg"
]
| See https://lists.gnu.org/archive/html/bug-texinfo/2018-09/msg00009.html
```
TEXINPUTS="../build-aux:$TEXINPUTS" \
MAKEINFO='/bin/bash /opt/Software/libredwg/build-aux/missing makeinfo -I .' \
texi2dvi --pdf --batch --build-dir=LibreDWG.t2p -o LibreDWG.pdf \
LibreDWG.texi
/usr/bin/texi2dvi: TeX neither supports -recorder nor outputs \openout lines in its log file
``` | makeinfo update broke make -C doc pdf | https://api.github.com/repos/LibreDWG/libredwg/issues/78/comments | 1 | 2018-12-17T11:36:34Z | 2019-01-09T12:46:38Z | https://github.com/LibreDWG/libredwg/issues/78 | 391,672,417 | 78 |
[
"LibreDWG",
"libredwg"
]
| Dereferencing null pointer is not a good idea, is it?
https://github.com/LibreDWG/libredwg/blob/da588c00827086fce3b41be08f3ae8223ba659ef/src/decode.c#L1813-L1818
Both PRE R13 and later versions have the same code. Consider reviewing it
https://github.com/LibreDWG/libredwg/blob/da588c00827086fce3b41be08f3ae8223ba659ef/src/dwg.spec#L2675-L2686
Pointer is used before being checked against null here
https://github.com/LibreDWG/libredwg/blob/da588c00827086fce3b41be08f3ae8223ba659ef/programs/dwggrep.c#L371-L373
`if (argc)`is always true. Did you mean `*argc`?
https://github.com/LibreDWG/libredwg/blob/da588c00827086fce3b41be08f3ae8223ba659ef/programs/dwgwrite.c#L245
https://github.com/LibreDWG/libredwg/blob/da588c00827086fce3b41be08f3ae8223ba659ef/programs/dwgwrite.c#L249 | Things found with static analysis | https://api.github.com/repos/LibreDWG/libredwg/issues/77/comments | 1 | 2018-12-16T21:51:22Z | 2019-01-09T12:46:46Z | https://github.com/LibreDWG/libredwg/issues/77 | 391,508,725 | 77 |
[
"LibreDWG",
"libredwg"
]
| For consistency with DWG and DXF, and the dwgfilter query syntax.
Two options: Either
* resemble more the DXF structure (easier filter queries), with TABLES, BLOCKS, OBJECTS (see work/json-dxflike branch), or
* more the DWG structure (easier writable via in_json), with the auxheader, r2004_file_header, handles, but no extra TABLES, OBJECTS.
In the long run, json and yaml should resemble more the DWG structure, for easier offline DWG editing, e.g via jq (dwgfilter).
The documentation reads:
> We write and read *(not yet)* to our own JSON format, which is a
readable 1:1 mapping of the DWG structures, and carries much more
information than the DXF format. The idea is to dump a DWG to JSON and
filter/query or postprocess it with more powerful JSON query tools such
as **jq** (https://stedolan.github.io/jq/), and optionally import
it back in. JSON is much better structured than DXF.
----
I found no easy way to filter `jq '.ENTITIES[] | {entity: "LINE"}' example_2000.json`
`jq '.ENTITIES[] | {object: "LAYER", entry_name}' <examples_2000.json |grep -name|grep -v null`
* rename the TABLE field `entry_name` to just `name`
* rename ENTITIES to OBJECTS (which do include TABLES and BLOCKS)
| JSON: separate OBJECTS from ENTITIES? | https://api.github.com/repos/LibreDWG/libredwg/issues/76/comments | 0 | 2018-12-14T10:00:51Z | 2019-01-09T12:47:01Z | https://github.com/LibreDWG/libredwg/issues/76 | 391,042,703 | 76 |
[
"LibreDWG",
"libredwg"
]
| When writing to a pipe, the NOCOMMA hack (omitting the very last comma in a list) does not work yet.
If we are unlucky, we really have to check for each list output for the very last element and skip the comma there. | out_json NOCOMMA hack with pipes | https://api.github.com/repos/LibreDWG/libredwg/issues/75/comments | 2 | 2018-12-14T08:38:16Z | 2020-03-25T20:42:03Z | https://github.com/LibreDWG/libredwg/issues/75 | 391,015,022 | 75 |
[
"LibreDWG",
"libredwg"
]
| There's a `dwg_obj_layer_get_name`, how about the ability to `set` it too. I understand entities and layers both have a `layer_name` property, does that complicate things? How about tables? | api: add dwg_obj_layer_set_name | https://api.github.com/repos/LibreDWG/libredwg/issues/74/comments | 3 | 2018-12-13T14:15:06Z | 2020-01-16T23:30:53Z | https://github.com/LibreDWG/libredwg/issues/74 | 390,697,574 | 74 |
[
"LibreDWG",
"libredwg"
]
| Certain entities, e.g., `LINE`, don't have all of their relevant properties mapped, e.g., `start`, `end` into json:
{
"entity": "LINE",
"type": 19,
"size": 60,
"bitsize": 443,
"picture_exists": 0,
"thickness": 0.000000,
"extrusion.x": 0.000000,
"extrusion.y": 0.000000,
"extrusion.z": 1.000000
}
Any ideas how to extend the data? I can't work out how to. | `out_json.c` produces incomplete entity information | https://api.github.com/repos/LibreDWG/libredwg/issues/73/comments | 3 | 2018-12-13T09:56:17Z | 2019-01-09T12:47:24Z | https://github.com/LibreDWG/libredwg/issues/73 | 390,600,225 | 73 |
[
"LibreDWG",
"libredwg"
]
| The HANDSEED DXF value never matches the HANDSEED DWG value.
See also https://sourceforge.net/p/libdwg/tickets/8/
```
$ grep -A2 HANDSEED td/Drawing_2000.dxf | tail -n1
6DF
$ grep HANDSEED Drawing_2000.log
HANDSEED: 0x5bc [RL 0]
HANDSEED: HANDLE(0.2.5BC) absolute:5BC [0]
```
printf "%x", 0x6df - 0x5bc => 0x123
This is libredwg unrelated and seems to be a DwgFiler/DxfFiler oddity.
But HANDSEED is a handle and needs to printed as hex. | HEADER.HANDSEED as HEX, and DXF off value | https://api.github.com/repos/LibreDWG/libredwg/issues/71/comments | 0 | 2018-12-12T12:39:46Z | 2019-01-09T12:48:44Z | https://github.com/LibreDWG/libredwg/issues/71 | 390,208,112 | 71 |
[
"LibreDWG",
"libredwg"
]
| With large DWG's with large offsets from handles, some offsets were misrepresented due to underflow. The last byte (4 bits actually) was not read.
MC:
Read 1 modular char (max 5 bytes, signed).
Read bytes until the high bit of the byte is 0, drop the highest bit and pad with 0.
If the last byte has 0x40 set, it's negative. (since the 0x80 bit is dropped, 0x40 becomes the highest bit then)
Since the result is int32_t (4 byte) but there needs to be the high/follow bit set,
the stream can be max 5 byte long (5*7 = 35 bit)
```
10000000 10000000 10000000 10000000 00000100
=> 0000000 0000000 0000000 0000000 0000100 (5*7 = 35)
=> 00001000 00000000 00000000 00000000 (4*8 = 32)
```
With 4 byte only 4*7=28 bit can be represented, the highest 4 (from 32) are missing for large offsets >= 0x1000000 (0b0001000000000000000000000000)
Detected and fixed by @DenisPryt in #65
The very same error came originally from libdwg, and is also present in all other open source dwg libs:
libdwg, libdxfrw, pythoncad | BITCODE_MC needs to read from 5 bytes, not 4 | https://api.github.com/repos/LibreDWG/libredwg/issues/70/comments | 0 | 2018-12-12T08:20:33Z | 2019-01-09T12:47:33Z | https://github.com/LibreDWG/libredwg/issues/70 | 390,112,010 | 70 |
[
"LibreDWG",
"libredwg"
]
| In principle like [osmfilter](https://wiki.openstreetmap.org/wiki/Osmfilter), but with a sane query expression language.
Something like XPath or JSONPath with the dot. notation seem to be the best fit.
* The query expression should look a bit like https://istio.io/docs/reference/config/policy-and-telemetry/expression-language/
* XPath supports trees, we only have lists, so `/` or `//` is unneeded.
* JSONPath uses the nicer dot syntax for fields, but is a bit too limited.
* Implementing a query language (parser, bytecode, vm) seems to be overkill, so rather just pass it through jq (https://stedolan.github.io/jq/manual/v1.6/) as json. This way dwgfilter can even be a simple shell script.
By default pure, only display the result of the filter query.
It also needs to handle destructive changes: --delete and --keep for simple boolean queries
and maybe also changes (renames, transform) by assignment ops (+=) or s///.
depends on: #59 | dwgfilter: XPath-like query expr | https://api.github.com/repos/LibreDWG/libredwg/issues/64/comments | 18 | 2018-12-06T07:37:40Z | 2020-02-24T12:26:02Z | https://github.com/LibreDWG/libredwg/issues/64 | 388,091,014 | 64 |
[
"LibreDWG",
"libredwg"
]
| Either the last member of the array needs to be NULL, or we need to return the count.
Since we don't want to change the API, we NULL-terminate it.
We also need to guard from an empty BLOCK_HEADER argument | fix GET_DWG_ENTITY | https://api.github.com/repos/LibreDWG/libredwg/issues/60/comments | 0 | 2018-11-29T12:46:18Z | 2018-11-30T10:13:37Z | https://github.com/LibreDWG/libredwg/issues/60 | 385,720,185 | 60 |
[
"LibreDWG",
"libredwg"
]
| It's required for interfacing dynamic languages to provide a better dynamic API, and for the importers, a precompiled list or hash of all known elements, objects and subtypes with all its properties.
These can be generated via processing the dwg.h or dwg.spec into gperf hashes or arrays.
The needed info per field would be: name, type, offsetof(), (dxf).
Then we could also implement a dwgfilter program (#64), which allows filtering on user-defined, dynamic objects and it's properties. e.g. dwglayer, dwgxrefs, ...
analog to [osmfilter](https://wiki.openstreetmap.org/wiki/Osmfilter)
we could also get rid of the massively big and unmaintainable dwg_api functions, replacing it with the dynamic versions, separated by type. and add a reflective api, e.g. return the VERTEX_2D fields, the type of the VERTEX_3D.point field, ...
* rename dwg_get_OBJECT(dwg) to dwg_getall_OBJECT(dwg)
* rename dwg_get_ENTITY(blkhdr) to dwg_getall_ENTITY(blkhdr)
* add dwg_get_OBJECT(obj, field) field getters by string (single field only)
* add dwg_set_HEADER(dwg, field, value, ...), dwg_set_OBJECT(obj, field, value, ...) set multiple fields.
e.g. for 3RD: dwg_set_VERTEX_2D(obj, "point", 0.0, 0.0, 1.0);
| add a dynamic object/field API | https://api.github.com/repos/LibreDWG/libredwg/issues/59/comments | 2 | 2018-11-29T12:31:17Z | 2019-01-30T10:16:37Z | https://github.com/LibreDWG/libredwg/issues/59 | 385,714,709 | 59 |
[
"LibreDWG",
"libredwg"
]
| Is it possible to extract xref information from a dwg ? | Extract Xref Information | https://api.github.com/repos/LibreDWG/libredwg/issues/57/comments | 8 | 2018-11-27T10:11:16Z | 2018-12-10T12:28:30Z | https://github.com/LibreDWG/libredwg/issues/57 | 384,717,096 | 57 |
[
"LibreDWG",
"libredwg"
]
| When running over some dwgs from the same project I get the errors
```
Warning: Invalid handleref: wanted code 4, got (1.7.0)
ERROR: Invalid LTYPE.dash x 61
ERROR: Invalid LTYPE.dash x 215
ERROR: num_inserts [RC 0]: 136!
Warning: Invalid handleref: wanted code 4, got (1.7.0)
ERROR: Invalid LTYPE.dash x 61
ERROR: Invalid LTYPE.dash x 215
``` | ERROR: Invalid LTYPE.dash x 61 | https://api.github.com/repos/LibreDWG/libredwg/issues/55/comments | 4 | 2018-11-27T09:47:08Z | 2018-12-02T14:05:32Z | https://github.com/LibreDWG/libredwg/issues/55 | 384,706,354 | 55 |
[
"LibreDWG",
"libredwg"
]
| There are a bunch of unknown classes for entities, if this is something I can help with please let me know and point me in the direction of the files I need to edit
```
Warning: Unknown Class object 541 AEC_DISP_PROPS_MASS_ELEM_MODEL (0x81)
Warning: Unknown Class object 542 AEC_DISP_REP_MASS_GROUP_MODEL (0x81)
Warning: Unknown Class object 544 AEC_DISP_REP_MASS_ELEM_MODEL (0x81)
Warning: Unknown Class object 545 AEC_DISP_REP_MASS_GROUP_PLAN (0x81)
Warning: Unknown Class object 543 AEC_DISP_PROPS_MASS_GROUP (0x81)
Warning: Unknown Class object 546 AEC_DISP_REP_CLIP_VOLUME_MODEL (0x81)
Warning: Unknown Class object 547 AEC_DISP_PROPS_CLIP_VOLUME (0x81)
Warning: Unknown Class object 548 AEC_DISP_REP_CLIP_VOLUME_RESULT (0x81)
Warning: Unknown Class object 549 AEC_DISP_REP_ANCHOR_EXT_TAG_TO_ENT (0x81)
Warning: Unknown Class object 550 AEC_DISP_PROPS_ENT (0x81)
Warning: Unknown Class object 551 AEC_DISP_REP_ANCHOR (0x81)
Warning: Unknown Class object 552 AEC_DISP_REP_CLIP_VOLUME_RESULT_SUBDIV (0x81)
Warning: Unknown Class object 553 AEC_DISP_PROPS_CLIP_VOLUME_RESULT (0x81)
Warning: Unknown Class object 554 AEC_DISP_REP_ANCHOR_TAG_TO_ENT (0x81)
Warning: Unknown Class object 555 AEC_DISP_REP_ANCHOR_ENT_TO_NODE (0x81)
Warning: Unknown Class object 556 AEC_DISP_REP_2D_SECTION (0x81)
Warning: Unknown Class object 557 AEC_DISP_PROPS_2D_SECTION (0x81)
Warning: Unknown Class object 558 AEC_DISP_REP_CLIP_VOLUME_PLAN (0x81)
Warning: Unknown Class object 559 AEC_DISP_REP_POLYGON_TRUECOLOUR (0x81)
Warning: Unknown Class object 560 AEC_DISP_PROPS_POLYGON_TRUECOLOUR (0x81)
Warning: Unknown Class object 561 AEC_DISP_REP_ENT_REF (0x81)
Warning: Unknown Class object 562 AEC_DISP_PROPS_ENT_REF (0x81)
Warning: Unknown Class object 563 AEC_DISP_REP_POLYGON_MODEL (0x81)
Warning: Unknown Class object 564 AEC_DISP_PROPS_POLYGON_MODEL (0x81)
Warning: Unknown Class object 565 AEC_DISP_REP_EDITINPLACEPROFILE (0x81)
Warning: Unknown Class object 566 AEC_DISP_PROPS_EDITINPLACEPROFILE_MODEL (0x81)
Warning: Unknown Class object 567 AEC_DISP_REP_MATERIAL (0x81)
Warning: Unknown Class object 568 AEC_DISP_PROPS_MATERIAL (0x81)
Warning: Unknown Class object 569 AEC_DISP_REP_MVBLOCK_REF (0x81)
Warning: Unknown Class object 570 AEC_DISP_REP_MASKBLOCK_REF (0x81)
Warning: Unknown Class object 571 AEC_DISP_PROPS_MASKBLOCK (0x81)
Warning: Unknown Class object 572 AEC_DISP_REP_DISPLAYTHEME (0x81)
Warning: Unknown Class object 573 AEC_DISP_PROPS_DISPLAYTHEME (0x81)
Warning: Unknown Class object 574 AEC_DISP_REP_LAYOUT_GRID2D (0x81)
Warning: Unknown Class object 575 AEC_DISP_PROPS_LAYOUT_GRID2D (0x81)
Warning: Unknown Class object 576 AEC_DISP_REP_LAYOUT_GRID3D (0x81)
Warning: Unknown Class object 577 AEC_DISP_PROPS_LAYOUT_GRID3D (0x81)
Warning: Unknown Class object 578 AEC_DISP_REP_LAYOUT_CURVE (0x81)
Warning: Unknown Class object 579 AEC_DISP_PROPS_LAYOUT_CURVE (0x81)
Warning: Unknown Class object 580 AEC_DISP_REP_MVBLOCK_REF_MODEL (0x81)
Warning: Unknown Class object 581 AEC_DISP_REP_SLICE (0x81)
Warning: Unknown Class object 582 AEC_DISP_PROPS_SLICE (0x81)
Warning: Unknown Class object 583 AEC_DISP_REP_CEILING_GRID (0x37d)
Warning: Unknown Class object 584 AEC_DISP_REP_CURTAIN_WALL_LAYOUT_PLAN (0x81)
Warning: Unknown Class object 585 AEC_DISP_PROPS_GRID_ASSEMBLY_PLAN (0x81)
Warning: Unknown Class object 586 AEC_DISP_REP_COLUMN_GRID (0x81)
``` | Warning Unknown Classes | https://api.github.com/repos/LibreDWG/libredwg/issues/53/comments | 1 | 2018-11-27T08:52:19Z | 2018-11-27T14:39:32Z | https://github.com/LibreDWG/libredwg/issues/53 | 384,684,454 | 53 |
[
"LibreDWG",
"libredwg"
]
| When running the command `dwg2dxf test.dwg` on the .dwg sent to @rurban you get the following output
```
Warning: Object handle not found, 80 in 11073 objects
Warning: Object handle not found, 208 in 11073 objects
Warning: Object handle not found, 208 in 11073 objects
Warning: Object handle not found, 82 in 11073 objects
Writing DXF file test.dxf
Segmentation fault (core dumped)
```
When opening the resulting dxf in librecad it recognises some of the layers but no lines or any other drawing elements | dwg2dxf fails | https://api.github.com/repos/LibreDWG/libredwg/issues/52/comments | 2 | 2018-11-27T08:38:13Z | 2018-11-27T14:33:17Z | https://github.com/LibreDWG/libredwg/issues/52 | 384,679,643 | 52 |
[
"LibreDWG",
"libredwg"
]
| When running the `dwglayers` on the .dwg sent to @rurban there is no output (no segfult) it just exits | dwglayers no output with Dictionaries | https://api.github.com/repos/LibreDWG/libredwg/issues/51/comments | 2 | 2018-11-27T08:36:44Z | 2018-11-27T11:52:52Z | https://github.com/LibreDWG/libredwg/issues/51 | 384,679,160 | 51 |
[
"LibreDWG",
"libredwg"
]
| http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=doc/Copyright/request-assign.future;hb=HEAD | copyright assignment denis | https://api.github.com/repos/LibreDWG/libredwg/issues/47/comments | 5 | 2018-11-24T20:19:14Z | 2018-12-01T08:06:16Z | https://github.com/LibreDWG/libredwg/issues/47 | 384,018,807 | 47 |
[
"LibreDWG",
"libredwg"
]
| Hi compiled and ran Libredwg and am trying to read some of our dwgs, I am unfortunately not a machine were I can anonymize the DWG so I can't upload it, does this error make senses without it ?
Drawing was made using Autocad 2016 | ERROR: Invalid insert_handles vcount 66. Need min. 528 bits for HANDLE, have 51 for BLOCK_HEADER | https://api.github.com/repos/LibreDWG/libredwg/issues/44/comments | 10 | 2018-11-20T10:43:31Z | 2018-11-27T08:25:28Z | https://github.com/LibreDWG/libredwg/issues/44 | 382,602,570 | 44 |
[
"LibreDWG",
"libredwg"
]
| In some reasons, 2 pointers refer in single object, and free this object twice.
Object is created in `dwg_decode_handleref_with_code` and stored in `dwg->object_ref` array. Then it return from function and assigned to object's `subentity` field.
In `dwg_free` at first some object is destroyed with his `subentity`, and then all `object_ref` is destroyed with thouse `subentity` one more time.
Can you help me fix this bug? Maybe you are know how this problem can be solved? | double free object_ref item | https://api.github.com/repos/LibreDWG/libredwg/issues/43/comments | 6 | 2018-11-19T15:55:40Z | 2018-11-20T14:53:33Z | https://github.com/LibreDWG/libredwg/issues/43 | 382,278,758 | 43 |
[
"LibreDWG",
"libredwg"
]
| Hi, during conversion from dwg to dxf, there is wrong polyline coordinates. such as :
Thanks for help.
[testdata.zip](https://github.com/LibreDWG/libredwg/files/2541335/testdata.zip)
ORİGİNAL :
AcDbPolyline
90
4
70
129
43
0.0
10
-10.0
20
50.0
10
-10.0
20
60.0
10
0.0
20
60.0
10
0.0
20
50.0
exported by libredwg :
AcDbPolyline
90
4
70
1
10
-10.00000000000000
20
50.00000000000000
10
-10.00000000000000
20
60.00000000000000
10
0.0
20
**-10.00000000000000** (must be 60)
10
0.0
20
50.00000000000000 | dxf polyline coordinates | https://api.github.com/repos/LibreDWG/libredwg/issues/40/comments | 2 | 2018-11-02T07:04:51Z | 2018-11-05T13:15:36Z | https://github.com/LibreDWG/libredwg/issues/40 | 376,692,504 | 40 |
[
"LibreDWG",
"libredwg"
]
| I've been converting DWG files made with some quite old version of AutoCAD, like 2004 or even 2002, I'm not sure, and discovered that the library (I've tried recently released v0.6) segfaults on some of them inside `dwg_model_space_ref()` in `dwg.c`, apparently while accessing `dwg->header_vars.BLOCK_RECORD_PSPACE` (stack trace is trivial so I'd waive it). This happens both on i386 and amd64.
Example of [problematic file](http://ftp.tu-graz.ac.at/pub/mind21/e5_experiment/fussabdruck_grundstueck/fu%DFabdruck_plus.dwg). | Segmentation fault in dwg_model_space_ref() | https://api.github.com/repos/LibreDWG/libredwg/issues/39/comments | 3 | 2018-08-30T13:05:12Z | 2018-11-07T09:33:08Z | https://github.com/LibreDWG/libredwg/issues/39 | 355,576,282 | 39 |
[
"LibreDWG",
"libredwg"
]
| We just changed BL to signed. revert that and add a seperate BLd to represent the two such dxf ranges.
BL as signed is a problem for vcount/rcount overflow detection with negative values. | add a seperate signed BLd type | https://api.github.com/repos/LibreDWG/libredwg/issues/36/comments | 0 | 2018-08-11T15:37:52Z | 2018-08-11T20:29:41Z | https://github.com/LibreDWG/libredwg/issues/36 | 349,742,685 | 36 |
[
"LibreDWG",
"libredwg"
]
| Hi, I installed all the dependencies the README mentioned, but when I excute "./configure --enable-trace --disable--write --disable-shared", still an error occured, please check it below:
```
checking for swig... /usr/bin/swig
checking SWIG version... 2.0.12
checking for SWIG library... /usr/share/swig2.0
checking for a Python interpreter with version >= 2.7... python
checking for python... /root/.pyenv/shims/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking for python2.7... (cached) /root/.pyenv/shims/python
checking for a version of Python >= '2.1.0'... yes
checking for the distutils Python package... yes
checking for Python include path... -I/root/.pyenv/versions/2.7.9/include/python2.7
checking for Python library path...
ac_python_libdir=/root/.pyenv/versions/2.7.9/lib/python2.7/config
ac_python_library=libpython2.7.a
ac_python_soname=libpython2.7.a
use the --enable-frameworked shared library
-L/root/.pyenv/versions/2.7.9/lib/python2.7/config -lpython2.7
checking for Python site-packages path... /root/.pyenv/versions/2.7.9/lib/python2.7/site-packages
checking python extra libraries... -lpthread -ldl -lutil
checking python extra linking flags... -Xlinker -export-dynamic
checking consistency of all components of python development environment... no
configure: error: in `/home/odoo/new/libredwg-0.5.0.1176':
configure: error:
Could not link test program to Python. Maybe the main Python library has been
installed in some non-standard library path. If so, pass it to configure,
via the LDFLAGS environment variable.
Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
============================================================================
ERROR!
You probably have to install the development version of the Python package
for your distribution. The exact name of this package varies among them.
============================================================================
```
but I already installed python-dev, and I excute "./configure LDFLAGS="-L/root/.pyenv/versions/2.7.9/lib/python2.7" PYTHON="/root/.pyenv/shims/python" --enable-trace", same error still happed. Here's my config.log, anything wrong about it?
[config.log](https://github.com/LibreDWG/libredwg/files/2273751/config.log)
| configure failed | https://api.github.com/repos/LibreDWG/libredwg/issues/35/comments | 5 | 2018-08-09T10:11:07Z | 2018-08-11T11:37:41Z | https://github.com/LibreDWG/libredwg/issues/35 | 349,063,718 | 35 |
[
"LibreDWG",
"libredwg"
]
| wrong obj_string_stream
on certain fixed types without strings do not call obj_string_stream() at all. add a new obj_has_strings(type). | r2007+ strings: wrong has_strings and offset | https://api.github.com/repos/LibreDWG/libredwg/issues/34/comments | 0 | 2018-07-29T07:00:22Z | 2018-07-29T10:50:38Z | https://github.com/LibreDWG/libredwg/issues/34 | 345,507,620 | 34 |
[
"LibreDWG",
"libredwg"
]
|
When open the crafted `dwg` file , it could tigger `double free` in `dwg2svg2`
Let's see the program error output
```
15:20 haclh@ubuntu:examples $ ./dwg2svg2 dfree_poc_155
......................................................................
......................................................................
......................................................................
=================================================================
*** Error in `./dwg2svg2': double free or corruption (fasttop): 0x0000000001336430 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f18b82547e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f18b825d37a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f18b826153c]
./dwg2svg2[0x499e0b]
./dwg2svg2[0x49a31a]
./dwg2svg2[0x4a18e9]
./dwg2svg2[0x4a239d]
./dwg2svg2[0x40d13f]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f18b81fd830]
./dwg2svg2[0x40d3a9]
======= Memory map: ========
00400000-00569000 r-xp 00000000 08:10 1140093 /home/haclh/vmdk/fuzz_workplace/libredwg-0.5.1048/examples/dwg2svg2
00768000-00769000 r--p 00168000 08:10 1140093 /home/haclh/vmdk/fuzz_workplace/libredwg-0.5.1048/examples/dwg2svg2
00769000-0076a000 rw-p 00169000 08:10 1140093 /home/haclh/vmdk/fuzz_workplace/libredwg-0.5.1048/examples/dwg2svg2
0076a000-0076c000 rw-p 00000000 00:00 0
01319000-0135b000 rw-p 00000000 00:00 0 [heap]
7f18b3dea000-7f18b3e00000 r-xp 00000000 08:01 1315919 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f18b3e00000-7f18b3fff000 ---p 00016000 08:01 1315919 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f18b3fff000-7f18b4000000 rw-p 00015000 08:01 1315919 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f18b4000000-7f18b4021000 rw-p 00000000 00:00 0
7f18b4021000-7f18b8000000 ---p 00000000 00:00 0
7f18b81dd000-7f18b839d000 r-xp 00000000 08:01 1366856 /lib/x86_64-linux-gnu/libc-2.23.so
7f18b839d000-7f18b859d000 ---p 001c0000 08:01 1366856 /lib/x86_64-linux-gnu/libc-2.23.so
7f18b859d000-7f18b85a1000 r--p 001c0000 08:01 1366856 /lib/x86_64-linux-gnu/libc-2.23.so
7f18b85a1000-7f18b85a3000 rw-p 001c4000 08:01 1366856 /lib/x86_64-linux-gnu/libc-2.23.so
7f18b85a3000-7f18b85a7000 rw-p 00000000 00:00 0
7f18b85a7000-7f18b86af000 r-xp 00000000 08:01 1315583 /lib/x86_64-linux-gnu/libm-2.23.so
7f18b86af000-7f18b88ae000 ---p 00108000 08:01 1315583 /lib/x86_64-linux-gnu/libm-2.23.so
7f18b88ae000-7f18b88af000 r--p 00107000 08:01 1315583 /lib/x86_64-linux-gnu/libm-2.23.so
7f18b88af000-7f18b88b0000 rw-p 00108000 08:01 1315583 /lib/x86_64-linux-gnu/libm-2.23.so
7f18b88b0000-7f18b88d6000 r-xp 00000000 08:01 1366854 /lib/x86_64-linux-gnu/ld-2.23.so
7f18b8aaf000-7f18b8ab3000 rw-p 00000000 00:00 0
7f18b8ad4000-7f18b8ad5000 rw-p 00000000 00:00 0
7f18b8ad5000-7f18b8ad6000 r--p 00025000 08:01 1366854 /lib/x86_64-linux-gnu/ld-2.23.so
7f18b8ad6000-7f18b8ad7000 rw-p 00026000 08:01 1366854 /lib/x86_64-linux-gnu/ld-2.23.so
7f18b8ad7000-7f18b8ad8000 rw-p 00000000 00:00 0
7fff6f0da000-7fff6f0fb000 rw-p 00000000 00:00 0 [stack]
7fff6f127000-7fff6f12a000 r--p 00000000 00:00 0 [vvar]
7fff6f12a000-7fff6f12c000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted
```
And the output with **asan**
```
15:20 haclh@ubuntu:examples $ ./dwg2svg2 dfree_poc_155
......................................................................
......................................................................
......................................................................
=================================================================
==101914==ERROR: AddressSanitizer: attempting double-free on 0x60400000dbd0 in thread T0:
#0 0x7f9dcd3e32ca in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x982ca)
#1 0x642d83 in dwg_free_eed /home/haclh/workplace/libredwg-0.5.1048/src/free.c:283
#2 0x6513db in dwg_free_UNKNOWN_OBJ /home/haclh/workplace/libredwg-0.5.1048/src/dwg.spec:5437
#3 0x6513db in dwg_free_BLOCK_HEADER /home/haclh/workplace/libredwg-0.5.1048/src/dwg.spec:2177
#4 0x664f98 in dwg_free_object /home/haclh/workplace/libredwg-0.5.1048/src/free.c:471
#5 0x667d2a in dwg_free /home/haclh/workplace/libredwg-0.5.1048/src/free.c:640
#6 0x42d81d in test_SVG /home/haclh/workplace/libredwg-0.5.1048/examples/dwg2svg2.c:92
#7 0x42d81d in main /home/haclh/workplace/libredwg-0.5.1048/examples/dwg2svg2.c:482
#8 0x7f9dccfa182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#9 0x42de88 in _start (/home/haclh/workplace/libredwg-0.5.1048/examples/dwg2svg2+0x42de88)
0x60400000dbd0 is located 0 bytes inside of 40-byte region [0x60400000dbd0,0x60400000dbf8)
freed by thread T0 here:
#0 0x7f9dcd3e32ca in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x982ca)
#1 0x47ee9f in dwg_decode_eed /home/haclh/workplace/libredwg-0.5.1048/src/decode.c:2311
previously allocated by thread T0 here:
#0 0x7f9dcd3e379a in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9879a)
#1 0x47e349 in dwg_decode_eed /home/haclh/workplace/libredwg-0.5.1048/src/decode.c:2304
SUMMARY: AddressSanitizer: double-free ??:0 __interceptor_free
==101914==ABORTING
```
According **debuging**, I found that When open the crafted `dwg` file , `dwg_free` could call `dwg_decode_eed` , in `dwg_free_object` first, it could call `dwg_free_BLOCK_HEADER` to free a pointer (for example : `0x789430` )
```
void
dwg_free_object(Dwg_Object *obj)
{
switch (obj->type)
{
case DWG_TYPE_TEXT:
........................
........................
........................
case DWG_TYPE_BLOCK_HEADER:
dwg_free_BLOCK_HEADER(dat, obj);
break;
```
The backtrace are as below
```
f 0 7ffff77884f0 free
► f 1 49a1c4 dwg_free_BLOCK_HEADER.isra.7+68
f 2 4a18e9 dwg_free_object+1161
f 3 4a239d dwg_free+157
f 4 40d13f main+575
f 5 40d13f main+575
f 6 7ffff7724830 __libc_start_main+240
```
And then it could call `dwg_free_BLOCK_HEADER` again , it could call `dwg_free_eed` to free `0x789430` again.
The backtrace are as below
```
pwndbg> bt
#0 __GI___libc_free (mem=0x789430) at malloc.c:2934
#1 0x0000000000499e0b in dwg_free_eed (obj=0x7988e8, obj=0x7988e8) at free.c:283
#2 0x000000000049a31a in dwg_free_BLOCK_HEADER (obj=0x7988e8, _dat=<optimized out>) at dwg.spec:2285
#3 0x00000000004a18e9 in dwg_free_object (obj=0x7988e8) at free.c:471
#4 0x00000000004a239d in dwg_free (dwg=dwg@entry=0x769400 <g_dwg>) at free.c:640
#5 0x000000000040d13f in test_SVG (filename=<optimized out>) at dwg2svg2.c:92
#6 main (argc=argc@entry=2, argv=argv@entry=0x7fffffffe4c8) at dwg2svg2.c:479
#7 0x00007ffff7724830 in __libc_start_main (main=0x40cf00 <main>, argc=2, argv=0x7fffffffe4c8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe4b8) at ../csu/libc-start.c:291
#8 0x000000000040d3a9 in _start ()
```
The poc file
```
https://gitee.com/hac425/fuzz_data/blob/master/double_free_on_libredwg_155
```
| double free in dwg_free | https://api.github.com/repos/LibreDWG/libredwg/issues/33/comments | 8 | 2018-07-20T23:26:33Z | 2019-04-21T05:47:30Z | https://github.com/LibreDWG/libredwg/issues/33 | 343,274,015 | 33 |
[
"LibreDWG",
"libredwg"
]
| When open the crafted `dwg` file , it could tigger `null point dereference` in `dwg2svg2`
Let's see the gdb output
```
Program received signal SIGSEGV, Segmentation fault.
0x00000000005fc91c in dwg_obj_block_control_get_block_headers (ctrl=0xa51e30 <g_dwg+3088>, error=<optimized out>) at dwg_api.c:17897
17897 ptx[i] = ctrl->block_headers[i];
LEGEND: STACK | HEAP | CODE | DATA | RWX | RODATA
─────────────────────────────────────────────────────────────────────────────────────────[ REGISTERS ]─────────────────────────────────────────────────────────────────────────────────────────
*RAX 0x7ffff7f6c800 ◂— 0xbebebebebebebebe
*RBX 0xa51e30 (g_dwg+3088) —▸ 0x60800000bfa0 ◂— 0x0
*RCX 0x7ffff7f6c800 ◂— 0xbebebebebebebebe
RDX 0x0
RDI 0x0
RSI 0x0
R8 0x0
*R9 0xa51e50 (g_dwg+3120) ◂— 0x0
*R10 0x14a3ca
*R11 0x7ffff7f8c818 ◂— 0x0
*R12 0x7ffff7f6c800 ◂— 0xbebebebebebebebe
*R13 0x4002
*R14 0x7fffffffe280 ◂— 0x41b58ab3
R15 0x0
*RBP 0x7fffffffe210 —▸ 0x7fffffffe300 —▸ 0x7fffffffe330 —▸ 0x7fffffffe3e0 —▸ 0x71ed30 (__libc_csu_init) ◂— ...
*RSP 0x7fffffffe1f0 ◂— 0x0
*RIP 0x5fc91c (dwg_obj_block_control_get_block_headers+217) ◂— mov rdx, qword ptr [rdx]
──────────────────────────────────────────────────────────────────────────────────────────[ DISASM ]───────────────────────────────────────────────────────────────────────────────────────────
► 0x5fc91c <dwg_obj_block_control_get_block_headers+217> mov rdx, qword ptr [rdx]
0x5fc91f <dwg_obj_block_control_get_block_headers+220> mov rdi, rcx
0x5fc922 <dwg_obj_block_control_get_block_headers+223> mov r8, rcx
0x5fc925 <dwg_obj_block_control_get_block_headers+226> shr r8, 3
0x5fc929 <dwg_obj_block_control_get_block_headers+230> cmp byte ptr [r8 + 0x7fff8000], 0
0x5fc931 <dwg_obj_block_control_get_block_headers+238> je dwg_obj_block_control_get_block_headers+245 <0x5fc938>
↓
0x5fc938 <dwg_obj_block_control_get_block_headers+245> mov qword ptr [rcx], rdx
0x5fc93b <dwg_obj_block_control_get_block_headers+248> add rcx, 8
0x5fc93f <dwg_obj_block_control_get_block_headers+252> cmp rcx, r11
0x5fc942 <dwg_obj_block_control_get_block_headers+255> jne dwg_obj_block_control_get_block_headers+164 <0x5fc8e7>
↓
0x5fc8e7 <dwg_obj_block_control_get_block_headers+164> mov rdx, rcx
───────────────────────────────────────────────────────────────────────────────────────[ SOURCE (CODE) ]───────────────────────────────────────────────────────────────────────────────────────
17892 {
17893 BITCODE_BS i;
17894 *error = 0;
17895 for (i=0; i < ctrl->num_entries; i++)
17896 {
► 17897 ptx[i] = ctrl->block_headers[i];
17898 }
17899 return ptx;
17900 }
17901 else
17902 {
───────────────────────────────────────────────────────────────────────────────────────────[
pwndbg> p ptx
$1 = (dwg_object_ref **) 0x7ffff7f6c800
pwndbg> p ctrl->block_headers
$2 = (Dwg_Object_Ref **) 0x0
pwndbg> bt
#0 0x00000000005fc91c in dwg_obj_block_control_get_block_headers (ctrl=0xa51e30 <g_dwg+3088>, error=<optimized out>) at dwg_api.c:17897
#1 0x0000000000403d88 in output_SVG (dwg=0xa51220 <g_dwg>) at dwg2svg2.c:358
#2 0x0000000000401af9 in test_SVG (filename=0x7fffffffe73a "segment_poc") at dwg2svg2.c:90
#3 0x0000000000404656 in main (argc=2, argv=0x7fffffffe4c8) at dwg2svg2.c:479
#4 0x00007ffff67b7830 in __libc_start_main (main=0x403fa3 <main>, argc=2, argv=0x7fffffffe4c8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe4b8) at ../csu/libc-start.c:291
#5 0x0000000000401919 in _start ()
pwndbg>
```
As you can see , crash in
```
ptx[i] = ctrl->block_headers[i];
```
and `null point dereference` is **0** , so `null point dereference` 。
The Vulnerability is that `dwg_obj_block_control_get_block_headers` in `dwg_api.c` don't check the `ctrl->block_headers` .
```
dwg_object_ref **
dwg_obj_block_control_get_block_headers(const dwg_obj_block_control *restrict ctrl,
int *restrict error)
{
dwg_object_ref **ptx = (dwg_object_ref**)
malloc(ctrl->num_entries * sizeof(Dwg_Object_Ref *));
if (ptx)
{
BITCODE_BS i;
*error = 0;
for (i=0; i < ctrl->num_entries; i++)
{
ptx[i] = ctrl->block_headers[i];
}
return ptx;
}
else
{
*error = 1;
LOG_ERROR("%s: null malloc", __FUNCTION__)
return NULL;
}
}
```
To fix it, please **verify the ctrl->block_headers** before use it.
The poc file
```
https://gitee.com/hac425/fuzz_data/blob/master/poc.dwg
```
| null pointer dereference in dwg_obj_block_control_get_block_headers | https://api.github.com/repos/LibreDWG/libredwg/issues/32/comments | 1 | 2018-07-20T14:22:14Z | 2018-07-22T20:49:34Z | https://github.com/LibreDWG/libredwg/issues/32 | 343,126,665 | 32 |
[
"LibreDWG",
"libredwg"
]
| See #27
An entity with color flag 0x40 needs to decode the DBCOLOR ref.
testcases: 2004/dbcolor and 2004/CascoUrbano | DBCOLOR reference | https://api.github.com/repos/LibreDWG/libredwg/issues/31/comments | 1 | 2018-07-13T13:04:49Z | 2018-07-23T13:47:25Z | https://github.com/LibreDWG/libredwg/issues/31 | 341,011,454 | 31 |
[
"LibreDWG",
"libredwg"
]
| add a .pc file | https://api.github.com/repos/LibreDWG/libredwg/issues/30/comments | 1 | 2018-07-05T13:49:21Z | 2018-07-06T07:12:16Z | https://github.com/LibreDWG/libredwg/issues/30 | 338,583,093 | 30 |
|
[
"LibreDWG",
"libredwg"
]
| fix the {DY}LD_LIBRARY_PATH and LDDLFLAGS.
and it clashes with an installed (older) dwg.h | perl check needs installed libredwg | https://api.github.com/repos/LibreDWG/libredwg/issues/29/comments | 0 | 2018-07-05T05:43:28Z | 2018-07-11T11:58:37Z | https://github.com/LibreDWG/libredwg/issues/29 | 338,433,692 | 29 |
[
"LibreDWG",
"libredwg"
]
| I found another interesting issue with decoding handles and offsets for objects :
[2004.zip](https://github.com/LibreDWG/libredwg/files/2144361/2004.zip)
I may be wrong but it looks like for long handle address ModularChar reading can use more than 4 bytes, up to 8. Although the handles are read, some section pages contains large values that are not fully decoded and all handle references from header to block controls (layers, etc.) are not matching. | Decode objects handles map incorrectly | https://api.github.com/repos/LibreDWG/libredwg/issues/28/comments | 3 | 2018-06-28T08:21:39Z | 2018-07-23T13:52:54Z | https://github.com/LibreDWG/libredwg/issues/28 | 336,520,550 | 28 |
[
"LibreDWG",
"libredwg"
]
| I have problems decoding hatch with gradient in these files v2004 :
[DWG.zip](https://github.com/LibreDWG/libredwg/files/2142198/DWG.zip)
Can you please take a look if the spec is correct? Strangely the same files converted to version 2000 or 2007 open fine. | Problem reading gradient hatch from files v2004 | https://api.github.com/repos/LibreDWG/libredwg/issues/27/comments | 11 | 2018-06-27T17:09:38Z | 2018-07-23T13:47:57Z | https://github.com/LibreDWG/libredwg/issues/27 | 336,315,547 | 27 |
[
"LibreDWG",
"libredwg"
]
| I has downloaded the zip, I want to use this library in windows. I created a C++ project and add the dwg.h into the head like this:
```
extern "C"{
#include <dwg.h>
}
```
and I copyed codes like this:
```
void main(){
const char * inputFilename = "XXXX.dwg";
Dwg_Data dwg = new Dwg_Data();
int errno = dwg_read_file((char *)inputFilename, dwg);
if (errno) {
fprintf(stderr, "Could not open DWG. Returned error code: $d\n", errno);
delete dwg;
}
Dwg_Object_BLOCK_CONTROL * ctrl = dwg->object[0].tio.object->tio.BLOCK_CONTROL;
dumpBlock(ctrl->model_space);
dumpBlock(ctrl->paper_space);
for (int i = 0; i < ctrl->num_entries; i++) {
dumpBlock(ctrl->block_headers[i]);
}
dwg_free(dwg);
}
```
but there are many bugs. what's wrong? Is that I can't add the dwg.h directly??? I'm not practice in writing codes. | Excuse me, after I downloaded the file libredwg-0.4.900-win64, what should I do to use the libredwg? | https://api.github.com/repos/LibreDWG/libredwg/issues/26/comments | 1 | 2018-06-27T09:22:11Z | 2018-06-28T09:43:41Z | https://github.com/LibreDWG/libredwg/issues/26 | 336,146,097 | 26 |
[
"LibreDWG",
"libredwg"
]
| Missing config.h file?
Currently, the highest support is to reach this version? | Is it possible to give the windows project file? | https://api.github.com/repos/LibreDWG/libredwg/issues/25/comments | 24 | 2018-06-22T11:35:45Z | 2021-07-10T23:20:21Z | https://github.com/LibreDWG/libredwg/issues/25 | 334,846,448 | 25 |
[
"LibreDWG",
"libredwg"
]
| They are created fine, for python and perl (in branch `work/perl`), but then they seem to miss even the most basic functionality.
I'd like to use them for some basic UI DWG viewer of the internal structures.
Maybe switch over to valabind vapi bindings for most scripting languages and C#/C++: c++, rust, go, node, java, python, perl, ruby, php, autolisp (via ARX). With a proper vapi file the generated swig file also looks much better than now. | fix SWIG bindings/switch to valabind | https://api.github.com/repos/LibreDWG/libredwg/issues/24/comments | 1 | 2018-06-21T17:43:30Z | 2018-06-22T20:10:21Z | https://github.com/LibreDWG/libredwg/issues/24 | 334,592,820 | 24 |
[
"LibreDWG",
"libredwg"
]
| * either as now, via calling the specialized TABLECONTENT method for r2010+ but leaving out RECORD, handle and other prefix methods.
* or by adding the TABLECONTENT struct to TABLE, obj->tc.FIELDS (easiest to implement)
* or inlining it as obj->FIELDS completely (less work for saveas). leave out old duplicate fields. | add TABLE TABLECONTENT subclassing | https://api.github.com/repos/LibreDWG/libredwg/issues/23/comments | 1 | 2018-06-20T11:52:46Z | 2019-10-30T08:07:36Z | https://github.com/LibreDWG/libredwg/issues/23 | 334,043,101 | 23 |
[
"LibreDWG",
"libredwg"
]
| Need to study the handles.
So far I disabled XRECORD dxf output | DXF import of XRECORD crashes acad | https://api.github.com/repos/LibreDWG/libredwg/issues/22/comments | 1 | 2018-06-15T06:52:44Z | 2018-06-15T18:50:59Z | https://github.com/LibreDWG/libredwg/issues/22 | 332,664,484 | 22 |
[
"LibreDWG",
"libredwg"
]
| Low precision DXF. Or call it `--basic`, but there `-b` is already taken to `--binary`.
Like the `--minimal` flag, but output more like with `dxfrw`. i.e. no SUBCLASS markers and handles, no dictionaries, reactors, ...
Creates smaller DXF files, and should still be readable by acad.
Looked at this again, it is wrong. Most checks needs to be versioned, not some arbitrary --low or minimal check.
TODO: down-conversions from unsupported entities on older DXF versions:
Since r13: Entities: LWPOLYLINE, HATCH, SPLINE, LEADER, DIMENSION, MTEXT, IMAGE,
BLOCK_RECORD.
Table BLOCK_RECORD.
add CLASSES for those
handle 5, 100, 105
non-all caps table names.
Since r14: handle 330 | maybe add dwg2dxf --low | https://api.github.com/repos/LibreDWG/libredwg/issues/21/comments | 0 | 2018-06-11T07:46:27Z | 2018-06-14T07:04:39Z | https://github.com/LibreDWG/libredwg/issues/21 | 331,078,513 | 21 |
[
"LibreDWG",
"libredwg"
]
| dxf and json out need to treat some binary data different than text.
e.g. encode chars as %02x
json also needs to encode unprintable chars via `+U` and escape `\` properly.
either add a FIELD_TB to the spec or check the dxf code in FIELD_T
in DXF we already have VALUE_BINARY | add a binary text type, look at the DXF code. | https://api.github.com/repos/LibreDWG/libredwg/issues/20/comments | 1 | 2018-06-10T16:34:41Z | 2019-01-09T12:51:02Z | https://github.com/LibreDWG/libredwg/issues/20 | 330,982,944 | 20 |
[
"LibreDWG",
"libredwg"
]
| make it two functions, add as public API, which initializes the empty object. go away with the current add functions, which reads fields from an empty zero stream.
If possible add default values already at _add_, like from a `DEFAULT { FIELD_VALUE(field) = 1.0; }` block. rename `IF_ENCODE_FROM_EARLIER` to `DEFAULT`. It must be the first block in a spec, and probably it needs to be mandatory to close the add function and start the decode function.
Then reading the fields from the dwg is a separate function. This is needed for all in_* modules and dwg_encode.
This separation is also needed for ACAD_TABLE, jumping with r2010+ to `dwg_ ##action _TABLECONTENT(dat,obj);` without the initialization (_add_) code. | api: separate dwg_decode_OBJECT and dwg_add_OBJECT | https://api.github.com/repos/LibreDWG/libredwg/issues/19/comments | 1 | 2018-06-10T15:23:55Z | 2018-06-20T08:49:41Z | https://github.com/LibreDWG/libredwg/issues/19 | 330,977,513 | 19 |
[
"LibreDWG",
"libredwg"
]
| with cmdline programs acting on really big files, free needs longer than processing the file.
e.g. with a 42MB DWG file, decode needs 40s and free >3m.
Add a flag to opts to skip it (`0x20` is the next), used by the cmdline apps. The kernel is much faster and better freeing it.
Additionally think of replacing the linear search in object_refs with a hashmap, like in the benegon branch. But write it by myself for LICENSE reasons, and it can be much better then the simple Android hashmap.
Timings: -O2 linear: > 2m, hash: 5s.
| skip free optionally | https://api.github.com/repos/LibreDWG/libredwg/issues/18/comments | 0 | 2018-06-10T11:27:42Z | 2018-06-11T17:10:21Z | https://github.com/LibreDWG/libredwg/issues/18 | 330,960,826 | 18 |
[
"LibreDWG",
"libredwg"
]
| The dwg2dxf output extra newline for every group code and group value in dxf file, so cannot open the DXF file generated by dwg2dxf. | dwg2dxf output extra newline in dxf file | https://api.github.com/repos/LibreDWG/libredwg/issues/17/comments | 9 | 2018-06-10T03:11:33Z | 2018-06-12T12:42:30Z | https://github.com/LibreDWG/libredwg/issues/17 | 330,936,441 | 17 |
[
"LibreDWG",
"libredwg"
]
| The pre-release LibreDWG for Windows cannot run, see follow picture:

| The pre-release for windows cannot run | https://api.github.com/repos/LibreDWG/libredwg/issues/15/comments | 7 | 2018-06-06T12:22:46Z | 2018-06-06T16:12:09Z | https://github.com/LibreDWG/libredwg/issues/15 | 329,844,172 | 15 |
[
"LibreDWG",
"libredwg"
]
| I have just compiled the lib, tried to load in a 2018 dwg file, and it outputs the following:
ERROR: This version of LibreDWG is only capable of safely decoding version R13-R2007 (code: AC1012-AC1021) DWG files.
Support for this version is still experimental. We don't decode all objects yet.
It will probably crash and/or give you invalid output.
ERROR: bit_read_BD: unexpected 2-bit code: '11'
ERROR: bit_read_BD: unexpected 2-bit code: '11'
ERROR: bit_read_BD: unexpected 2-bit code: '11'
ERROR: bit_read_BL: unexpected 2-bit code: '11'
Warning: Invalid handle pointer code 14
ERROR: Invalid handle-reference, longer than 4 bytes: 13.12.0
ERROR: Could not read handleref in the header variables section
ERROR: Invalid handle-reference, longer than 4 bytes: 5.6.0
ERROR: Could not read handleref in the header variables section
Warning: dwg_decode_handleref_with_code: Missing obj arg
Segmentation fault: 11 | Not working on 2018 CAD files | https://api.github.com/repos/LibreDWG/libredwg/issues/14/comments | 2 | 2018-06-01T23:00:12Z | 2018-06-08T09:42:53Z | https://github.com/LibreDWG/libredwg/issues/14 | 328,684,346 | 14 |
[
"LibreDWG",
"libredwg"
]
| add `-fvisibility=hidden`, and explicitly mark the public functions as EXPORT via
`__attribute__((visibility("default")))` resp. `__declspec(dllexport)`
mimics windows default visibility
otherwise we might get into trouble later when changing internal functions. | limit exported symbols -fvisibility=hidden | https://api.github.com/repos/LibreDWG/libredwg/issues/13/comments | 0 | 2018-06-01T22:18:10Z | 2018-06-02T09:43:00Z | https://github.com/LibreDWG/libredwg/issues/13 | 328,676,848 | 13 |
[
"LibreDWG",
"libredwg"
]
| it's getting absurd, 50MB for the lib.
use more generic helper functions, instead of inlining everything. | reduce codesize | https://api.github.com/repos/LibreDWG/libredwg/issues/12/comments | 1 | 2018-06-01T08:44:38Z | 2018-06-01T10:02:48Z | https://github.com/LibreDWG/libredwg/issues/12 | 328,431,579 | 12 |
[
"LibreDWG",
"libredwg"
]
| we have to jump through absurd hurdles in the API to get around that.
the `parent` points to the `_dwg_object_{entity, object}`, which points via the `object` field to the `_dwg_object`.
But beware that adding objects (realloc) moves and invalidates all internal cross pointers to Dwg_Object*, but not Dwg_Object_OBJECT*. Those are not realloced. Also not the object substructs.
They only problem I see are the dwg_{obj,ent}_obj->object links to the dwg_object*.
They need to be replaced by an objid.
Either scan the objects twice for the final size (but then we cannot add objects later, when writing), or make the parent link a handle or objid index.
Also when adding objects and a realloc happened, we need to re-resolve all handles/links. this btw is a release blocker, as we already added the add API.
for better performance alloc in bigger chunks, so we can skip the scan most of the times.
dwg_add needs to trigger a rescan flag btw. | api: add parent field to each _dwg_{entity,object}_ENTITY | https://api.github.com/repos/LibreDWG/libredwg/issues/11/comments | 1 | 2018-06-01T08:39:44Z | 2018-06-02T12:03:44Z | https://github.com/LibreDWG/libredwg/issues/11 | 328,429,927 | 11 |
[
"LibreDWG",
"libredwg"
]
| The few new/delete/free functions from the dwg_api are basically useless,
as they don't add/delete the entity to the DWG. We need to add a Dwg_Object
and the associated Dwg_Object_Entity and then the Dwg_Entity_CIRCLE.
Same for delete.
See encode.c for dwg_add_##ENTITY for the proper API, but these are untested (waiting for dwgwrite/dxf2dwg).
Use dwg_add_##ENTITY and dwg_free_object() instead.
Add these to the header, and document it. | new/delete/free API fixup | https://api.github.com/repos/LibreDWG/libredwg/issues/10/comments | 0 | 2018-05-31T08:19:16Z | 2018-06-01T08:32:23Z | https://github.com/LibreDWG/libredwg/issues/10 | 328,038,922 | 10 |
[
"LibreDWG",
"libredwg"
]
| there exist various api functions to change the number of some elements without changing the associated array itself, e.g. dwg_ent_polyline_mesh_set_num_n_verts without setting the n_verts array.
all the set_num_ api functions need to go, and maybe add array `add` (at the end) and `delete` (at some index).
| api: remove array num setters, add add/delete api | https://api.github.com/repos/LibreDWG/libredwg/issues/9/comments | 1 | 2018-05-26T11:56:01Z | 2018-05-26T15:53:19Z | https://github.com/LibreDWG/libredwg/issues/9 | 326,732,785 | 9 |
[
"LibreDWG",
"libredwg"
]
| for consistency
```
include/dwg.h: BITCODE_BL frozen_layer_count;
include/dwg.h: BITCODE_BL instance_count; /* 91 Instance count for a custom class */
include/dwg.h: BITCODE_BL owned_obj_count;
include/dwg.h: BITCODE_BL owned_object_count;
include/dwg.h: BITCODE_BS attr_def_count;
include/dwg.h: BITCODE_BS m_vert_count;
include/dwg.h: BITCODE_BS n_vert_count;
include/dwg.h: BITCODE_RL insert_count;
include/dwg.h:dwg_get_entity_count(const Dwg_Data *);
include/dwg.h:dwg_get_layer_count(const Dwg_Data *);
include/dwg.h:dwg_get_object_count(const Dwg_Data *dwg);
include/dwg.h:dwg_get_object_object_count(const Dwg_Data *dwg);
```
e.g. dwg_get_numobjects, dwg_get_numentities, numfrozen_layers, ...
we have way more num* fields than _count. | rename *_count fields to num* | https://api.github.com/repos/LibreDWG/libredwg/issues/8/comments | 1 | 2018-05-25T11:43:52Z | 2018-05-26T15:51:46Z | https://github.com/LibreDWG/libredwg/issues/8 | 326,489,927 | 8 |
[
"LibreDWG",
"libredwg"
]
| nobody else names it SHAPEFILE, only the ODA.
dxf names it STYLE and $TEXTSTYLE,
AutoCAD names it AcDbTextStyleTable,
libdxfrw names it STYLE and TEXTSTYLE | rename SHAPEFILE object/table to STYLE | https://api.github.com/repos/LibreDWG/libredwg/issues/7/comments | 1 | 2018-05-24T09:25:02Z | 2018-05-24T10:30:34Z | https://github.com/LibreDWG/libredwg/issues/7 | 326,036,093 | 7 |
[
"LibreDWG",
"libredwg"
]
| Hello @rurban
When add Windows Visual Studio support?
Best Regards,
Shing Liu | Windows Visual Studio support | https://api.github.com/repos/LibreDWG/libredwg/issues/6/comments | 1 | 2018-05-14T12:57:45Z | 2018-06-01T08:33:03Z | https://github.com/LibreDWG/libredwg/issues/6 | 322,805,214 | 6 |
[
"LibreDWG",
"libredwg"
]
| I've add a `--enable-python=<python path>` flag for a `--enable-python=python3.6` cfg arg, but the probe fails. | add python 3.6 support | https://api.github.com/repos/LibreDWG/libredwg/issues/5/comments | 1 | 2018-05-13T10:14:44Z | 2018-05-18T15:08:24Z | https://github.com/LibreDWG/libredwg/issues/5 | 322,581,429 | 5 |
[
"LibreDWG",
"libredwg"
]
| find a simple POSIX way for this makefile (i.e. BSD make) | programs/Makefile.am:74: warning: *F: non-POSIX variable name | https://api.github.com/repos/LibreDWG/libredwg/issues/4/comments | 1 | 2018-05-13T10:12:58Z | 2018-05-25T08:49:46Z | https://github.com/LibreDWG/libredwg/issues/4 | 322,581,334 | 4 |
[
"LibreDWG",
"libredwg"
]
| travis (ubuntu) make distcheck:
`make[3]: *** No rule to make target `libredwg.py', needed by `distdir'. Stop.`
See e.g. https://travis-ci.org/LibreDWG/libredwg/jobs/377595525
Obviously a failing SWIG probe or rule.
This prevents us from generating binary releases via travis. Which is not important, just nice to have.
Works fine on debian testing, darwin and windows. | make distcheck on travis: libredwg.py | https://api.github.com/repos/LibreDWG/libredwg/issues/3/comments | 1 | 2018-05-11T06:20:20Z | 2018-05-13T10:51:23Z | https://github.com/LibreDWG/libredwg/issues/3 | 322,181,016 | 3 |
[
"LibreDWG",
"libredwg"
]
| dejagnu itself is probed fine.
```
[00:01:15] checking dejagnu.h usability... yes
[00:01:15] checking dejagnu.h presence... yes
[00:01:15] checking for dejagnu.h... yes
```
e.g. https://ci.appveyor.com/project/rurban/libredwg/build/0.4.25/job/cprh3drj2u830jnm#L2249
libtool: link: gcc -fno-strict-aliasing -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-missing-field-initializers -Wno-cast-align -Wformat=2 -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Warray-bounds -Wreturn-type -Wswitch-enum -Wswitch-default -Wduplicated-cond -Wlogical-op -Wnull-dereference -Wdouble-promotion -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -Wimplicit-function-declaration -Wold-style-definition -Wjump-misses-init -Wno-error=unused-variable -Wno-error=unused-parameter -Wno-error=unused-but-set-variable -Wno-error=missing-field-initializers -Wno-error=cast-align -g -o .libs/3dsolid.exe 3dsolid.o ../../src/.libs/libredwg.dll.a -L/usr/local/lib
```
3dsolid.o: In function `api_process':
/cygdrive/c/projects/libredwg/testsuite/testcases/3dsolid.c:26: undefined reference to `pass'
/cygdrive/c/projects/libredwg/testsuite/testcases/3dsolid.c:28: undefined reference to `fail'
/cygdrive/c/projects/libredwg/testsuite/testcases/3dsolid.c:34: undefined reference to `pass'
/cygdrive/c/projects/libredwg/testsuite/testcases/3dsolid.c:36: undefined reference to `fail'
...
```
See https://gcc.gnu.org/bugzilla//show_bug.cgi?id=63613
we need to add `-fgnu89-inline` | cygwin, ubuntu fails to link dejagnu | https://api.github.com/repos/LibreDWG/libredwg/issues/2/comments | 1 | 2018-05-06T16:05:15Z | 2018-08-02T09:35:41Z | https://github.com/LibreDWG/libredwg/issues/2 | 320,604,997 | 2 |
[
"LibreDWG",
"libredwg"
]
| someone, maybe CRC, is overwriting the Dwg_Struct after num_classes,
32bit only. with dwg2svg2 only.
CRC = 36953}, num_classes = 4,
dwg_class = 0x8153100, num_objects = 61, object = 0x8158398, num_layers = 0,
num_entities = 12, num_object_refs = 154, object_ref = 0x8155b78, layer_control = 0x81532a0,
mspace_block = 0x8154ff0, pspace_block = 0x8156560,
=>
CRC = 65028}, num_classes = 3086986712,
dwg_class = 0xad9f3224, num_objects = 1336173547, object = 0x9059, num_layers = 4,
num_entities = 135606528, num_object_refs = 61, object_ref = 0x8158398,
layer_control = 0x0, mspace_block = 0xc, pspace_block = 0x9a,
CRC ... num_entities is wrong.
| 32bit crashes: dwg2svg2 | https://api.github.com/repos/LibreDWG/libredwg/issues/1/comments | 1 | 2018-05-06T16:04:36Z | 2018-05-13T16:20:35Z | https://github.com/LibreDWG/libredwg/issues/1 | 320,604,943 | 1 |
[
"strukturag",
"libheif"
]
| clang:
```
D:\M\msys64\clang32\bin\clang++.exe -DENABLE_MULTITHREADING_SUPPORT=1 -DENABLE_PARALLEL_TILE_DECODING=1 -DHAVE_AOM_DECODER=1 -DHAVE_AOM_ENCODER=1 -DHAVE_BROTLI=1 -DHAVE_DAV1D=1 -DHAVE_JPEG_DECODER=1 -DHAVE_JPEG_ENCODER=1 -DHAVE_KVAZAAR=1 -DHAVE_KVAZAAR_ENABLE_LOGGING=1 -DHAVE_LIBDE265=1 -DHAVE_LIBSHARPYUV=1 -DHAVE_OPENJPEG_DECODER=1 -DHAVE_OPENJPEG_ENCODER=1 -DHAVE_RAV1E=1 -DHAVE_UNISTD_H -DHAVE_VISIBILITY -DHAVE_X265=1 -DHAVE_ZLIB=1 -DLIBHEIF_EXPORTS -Dheif_EXPORTS -IC:/_/B/src/build-CLANG32 -IC:/_/B/src/libheif-1.18.2/libheif -IC:/_/B/src/libheif-1.18.2/libheif/api -IC:/_/B/src/libheif-1.18.2/include/libheif -IC:/_/B/src/libheif-1.18.2/include -ID:/M/msys64/clang32/include/rav1e -ID:/M/msys64/clang32/include/webp -isystem D:/M/msys64/clang32/include/openjpeg-2.5 -march=pentium4 -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -DNDEBUG -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wno-error=tautological-compare -Wno-error=tautological-constant-out-of-range-compare -Wno-error=potentially-evaluated-expression -MD -MT libheif/CMakeFiles/heif.dir/plugins/decoder_openjpeg.cc.obj -MF libheif\CMakeFiles\heif.dir\plugins\decoder_openjpeg.cc.obj.d -o libheif/CMakeFiles/heif.dir/plugins/decoder_openjpeg.cc.obj -c C:/_/B/src/libheif-1.18.2/libheif/plugins/decoder_openjpeg.cc
C:/_/B/src/libheif-1.18.2/libheif/plugins/decoder_openjpeg.cc:259:56: error: no matching constructor for initialization of 'std::unique_ptr<opj_codec_t, void (*)(opj_codec_t *)>' (aka 'unique_ptr<void *, void (*)(void **)>')
259 | std::unique_ptr<opj_codec_t, void (*)(opj_codec_t*)> l_codec(opj_create_decompress(OPJ_CODEC_J2K),
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
260 | opj_destroy_codec);
```
gcc:
```
D:\M\msys64\mingw32\bin\g++.exe -DENABLE_MULTITHREADING_SUPPORT=1 -DENABLE_PARALLEL_TILE_DECODING=1 -DHAVE_AOM_DECODER=1 -DHAVE_AOM_ENCODER=1 -DHAVE_BROTLI=1 -DHAVE_DAV1D=1 -DHAVE_JPEG_DECODER=1 -DHAVE_JPEG_ENCODER=1 -DHAVE_KVAZAAR=1 -DHAVE_KVAZAAR_ENABLE_LOGGING=1 -DHAVE_LIBDE265=1 -DHAVE_LIBSHARPYUV=1 -DHAVE_OPENJPEG_DECODER=1 -DHAVE_OPENJPEG_ENCODER=1 -DHAVE_RAV1E=1 -DHAVE_UNISTD_H -DHAVE_VISIBILITY -DHAVE_X265=1 -DHAVE_ZLIB=1 -DLIBHEIF_EXPORTS -Dheif_EXPORTS -IC:/_/B/src/build-MINGW32 -IC:/_/B/src/libheif-1.18.2/libheif -IC:/_/B/src/libheif-1.18.2/libheif/api -IC:/_/B/src/libheif-1.18.2/include/libheif -IC:/_/B/src/libheif-1.18.2/include -ID:/M/msys64/mingw32/include/rav1e -ID:/M/msys64/mingw32/include/webp -isystem D:/M/msys64/mingw32/include/openjpeg-2.5 -march=pentium4 -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -DNDEBUG -std=c++11 -fvisibility=hidden -fno-keep-inline-dllexport -Wall -Werror -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -MD -MT libheif/CMakeFiles/heif.dir/plugins/decoder_openjpeg.cc.obj -MF libheif\CMakeFiles\heif.dir\plugins\decoder_openjpeg.cc.obj.d -o libheif/CMakeFiles/heif.dir/plugins/decoder_openjpeg.cc.obj -c C:/_/B/src/libheif-1.18.2/libheif/plugins/decoder_openjpeg.cc
C:/_/B/src/libheif-1.18.2/libheif/plugins/decoder_openjpeg.cc: In function 'heif_error openjpeg_decode_image(void*, heif_image**)':
C:/_/B/src/libheif-1.18.2/libheif/plugins/decoder_openjpeg.cc:260:81: error: no matching function for call to 'std::unique_ptr<void*, void (*)(void**)>::unique_ptr(void**, void (__attribute__((stdcall)) &)(void**))'
260 | opj_destroy_codec);
``` | 1.18.2 fails to build for 32bit Windows | https://api.github.com/repos/strukturag/libheif/issues/1262/comments | 1 | 2024-08-09T12:53:03Z | 2024-08-10T10:36:45Z | https://github.com/strukturag/libheif/issues/1262 | 2,457,855,693 | 1,262 |
[
"strukturag",
"libheif"
]
| The GraphicsMagick oss-fuzz build also builds libheif. There is a failure while building libheif in the 8/8/2024 build viewable at [OSS-Fuzz Build Status](https://oss-fuzz-build-logs.storage.googleapis.com/index.html#graphicsmagick).
The error message coming out is "merror: muse of undeclared identifier 'properties'". | libheif libheif/libheif/api/libheif/heif_properties.cc fails to compile (as part of GraphicsMagick oss-fuzz build) | https://api.github.com/repos/strukturag/libheif/issues/1260/comments | 2 | 2024-08-08T22:23:39Z | 2024-08-10T10:41:33Z | https://github.com/strukturag/libheif/issues/1260 | 2,456,743,016 | 1,260 |
[
"strukturag",
"libheif"
]
| I have an issue with viewing large HEIC files from my phone s24 ultra.
50 MPx filex are showing, not so fast as jpeg, but it works fine, 200 MPx files cause blinking eog and broken UI, program can be closed only by killing process (xkill or kill -9 pid)
I have added 3 files in 12 50 200 MPx and eog screenshot. https://www.dropbox.com/scl/fo/e9mp4wb2akr578da8zyuu/ADT2ieu-DThdStTtCfSRIdc?rlkey=dsmru7cs6y3lbeduqsspqk9lp&dl=0
list of installled libraries:
>apt list | grep heif
>heif-gdk-pixbuf/noble,now 1.17.6-1ubuntu4 amd64 [installed]
>heif-gdk-pixbuf/noble 1.17.6-1ubuntu4 i386
>heif-thumbnailer/noble,now 1.17.6-1ubuntu4 amd64 [installed]
>heif-thumbnailer/noble 1.17.6-1ubuntu4 i386
>kodi-imagedecoder-heif/noble 20.1.0+ds1-3build1 amd64
>libheif-dev/noble 1.17.6-1ubuntu4 amd64
>libheif-dev/noble 1.17.6-1ubuntu4 i386
>libheif-examples/noble,now 1.17.6-1ubuntu4 amd64 [installed]
>libheif-examples/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-aomdec/noble,now 1.17.6-1ubuntu4 amd64 [installed,automatic]
>libheif-plugin-aomdec/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-aomenc/noble,now 1.17.6-1ubuntu4 amd64 [installed]
>libheif-plugin-aomenc/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-dav1d/noble 1.17.6-1ubuntu4 amd64
>libheif-plugin-dav1d/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-ffmpegdec/noble 1.17.6-1ubuntu4 amd64
>libheif-plugin-ffmpegdec/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-j2kdec/noble 1.17.6-1ubuntu4 amd64
>libheif-plugin-j2kdec/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-j2kenc/noble 1.17.6-1ubuntu4 amd64
>libheif-plugin-j2kenc/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-jpegdec/noble 1.17.6-1ubuntu4 amd64
>libheif-plugin-jpegdec/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-jpegenc/noble 1.17.6-1ubuntu4 amd64
>libheif-plugin-jpegenc/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-libde265/noble,now 1.17.6-1ubuntu4 amd64 [installed,automatic]
>libheif-plugin-libde265/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-rav1e/noble 1.17.6-1ubuntu4 amd64
>libheif-plugin-svtenc/noble 1.17.6-1ubuntu4 amd64
>libheif-plugin-svtenc/noble 1.17.6-1ubuntu4 i386
>libheif-plugin-x265/noble 1.17.6-1ubuntu4 amd64
>libheif-plugin-x265/noble 1.17.6-1ubuntu4 i386
>libheif1/noble,now 1.17.6-1ubuntu4 amd64 [installed]
>libheif1/noble 1.17.6-1ubuntu4 i386
>librust-libheif-rs-dev/noble 0.20.0-5 amd64
>librust-libheif-sys-dev/noble 1.16.2-5 amd64
>
I also tried gThumb and have same issue, looks like problem not directly related to HEIC format, but to too huge file resolution.
my machine
>Ubuntu 24.04 LTS x86_64
>6.9.12-060912-generic
>GNOME 46.0
>Metacity
[heif.zip](https://github.com/user-attachments/files/16507040/heif.zip)
| support of 200MPx files from s24 ultra | https://api.github.com/repos/strukturag/libheif/issues/1259/comments | 3 | 2024-08-06T07:43:51Z | 2024-08-07T17:24:21Z | https://github.com/strukturag/libheif/issues/1259 | 2,450,183,903 | 1,259 |
[
"strukturag",
"libheif"
]
| Various `uncompressed` tests are failing on platforms like powerpc, ppc64 or sparc64 when building for Debian.
Example run:
https://buildd.debian.org/status/fetch.php?pkg=libheif&arch=powerpc&ver=1.18.1-1&stamp=1722512466&raw=0
```
The following tests FAILED:
5 - uncompressed_decode_generic_compression (Failed)
6 - uncompressed_decode_mono (Failed)
7 - uncompressed_decode_rgb (Failed)
8 - uncompressed_decode_rgb16 (Failed)
9 - uncompressed_decode_rgb565 (Failed)
10 - uncompressed_decode_rgb7 (Failed)
11 - uncompressed_decode_ycbcr (Failed)
12 - uncompressed_decode_ycbcr420 (Failed)
13 - uncompressed_decode_ycbcr422 (Failed)
```
Other examples available on https://buildd.debian.org/status/package.php?p=libheif (click on the "Build-Attempted" links).
CC @bradh as I think you know probably best about the tests. Thanks! | "uncompressed" tests fail on various platforms | https://api.github.com/repos/strukturag/libheif/issues/1256/comments | 3 | 2024-08-01T15:00:13Z | 2024-08-03T00:33:24Z | https://github.com/strukturag/libheif/issues/1256 | 2,442,699,757 | 1,256 |
[
"strukturag",
"libheif"
]
| When building libheif Debian packages under pbuilder/cowbuilder, I'm seeing the following test failures:
```
test 3
Start 3: encode_jpeg2000
3: Test command: /build/libheif/libheif/obj-x86_64-linux-gnu/tests/encode_jpeg2000
3: Test timeout computed to be: 1500
3:
3: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3: encode_jpeg2000 is a Catch v2.13.9 host application.
3: Run with -? for options
3:
3: -------------------------------------------------------------------------------
3: Encode JPEG2000 lossy
3: -------------------------------------------------------------------------------
3: ./tests/encode_jpeg2000.cc:76
3: ...............................................................................
3:
3: ./tests/encode_jpeg2000.cc:53: FAILED:
3: REQUIRE( err.code == heif_error_Ok )
3: with expansion:
3: 3 == 0
3:
3: -------------------------------------------------------------------------------
3: Encode JPEG2000 lossless
3: -------------------------------------------------------------------------------
3: ./tests/encode_jpeg2000.cc:82
3: ...............................................................................
3:
3: ./tests/encode_jpeg2000.cc:53: FAILED:
3: REQUIRE( err.code == heif_error_Ok )
3: with expansion:
3: 3 == 0
3:
3: ===============================================================================
3: test cases: 2 | 2 failed
3: assertions: 10 | 8 passed | 2 failed
3:
1/3 Test #3: encode_jpeg2000 ..................***Failed 0.06 sec
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encode_jpeg2000 is a Catch v2.13.9 host application.
Run with -? for options
-------------------------------------------------------------------------------
Encode JPEG2000 lossy
-------------------------------------------------------------------------------
./tests/encode_jpeg2000.cc:76
...............................................................................
./tests/encode_jpeg2000.cc:53: FAILED:
REQUIRE( err.code == heif_error_Ok )
with expansion:
3 == 0
-------------------------------------------------------------------------------
Encode JPEG2000 lossless
-------------------------------------------------------------------------------
./tests/encode_jpeg2000.cc:82
...............................................................................
./tests/encode_jpeg2000.cc:53: FAILED:
REQUIRE( err.code == heif_error_Ok )
with expansion:
3 == 0
===============================================================================
test cases: 2 | 2 failed
assertions: 10 | 8 passed | 2 failed
```
Full build log:
[libheif_jpeg2000_errors.txt](https://github.com/user-attachments/files/16431383/libheif_jpeg2000_errors.txt)
This happens when building packages for Ubuntu 22.04, Debian 11 and Debian 12.
This is with libheif 1.18.1. This problem did not appear on libheif 1.17.6.
| encode_jpeg2000 test failures | https://api.github.com/repos/strukturag/libheif/issues/1254/comments | 6 | 2024-07-30T17:21:54Z | 2024-07-31T21:39:44Z | https://github.com/strukturag/libheif/issues/1254 | 2,438,321,906 | 1,254 |
[
"strukturag",
"libheif"
]
| [1.heic.zip](https://github.com/user-attachments/files/16412917/1.heic.zip)
<img width="586" alt="image" src="https://github.com/user-attachments/assets/e3cc7e1b-3aad-45e7-bbcc-436301661911">
| libheif-1.8.0: image display blurry screen after decode | https://api.github.com/repos/strukturag/libheif/issues/1253/comments | 1 | 2024-07-29T12:27:45Z | 2024-07-29T13:50:39Z | https://github.com/strukturag/libheif/issues/1253 | 2,435,285,201 | 1,253 |
[
"strukturag",
"libheif"
]
| Hello,
https://github.com/strukturag/libheif/blob/master/libheif/plugins/decoder_openjpeg.cc
I observed that `opj_stream_destroy(stream);` is called only in case success but not in case of some previous errors.
I think that `opj_stream_destroy` should be used in the error handlers too.
When I look at example usage of openjpeg in https://github.com/uclouvain/openjpeg/blob/master/tests/test_tile_decoder.c
I have impression that `opj_destroy_codec` and `opj_image_destroy` should be used in the code too.
| memory leak in openjpeg_decode_image | https://api.github.com/repos/strukturag/libheif/issues/1251/comments | 2 | 2024-07-25T12:44:34Z | 2024-07-29T15:56:54Z | https://github.com/strukturag/libheif/issues/1251 | 2,429,872,993 | 1,251 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.