I compiled libredwg for converting with dwg2dxf on a Ubuntu 23.10

If I run dwg2dxf file2019.dwg file2019.dwg
I get this Error:

```
Reading DWG file file2019.dwg
Warning: checksum: 0x2fbea88a (calculated) CRC mismatch 0x29367234-0x29398170

ERROR: 
Invalid comp_bytes 4 > 3 bytes left (vs 3)
ERROR: Failed to read R2004 Section Page Map.
ERROR: Failed to decode file: `file2019.dwg` 0x440

READ ERROR 0x440
Reading DWG file file2019.dxf
ERROR: File not found: `file2019.dxf`

READ ERROR 0x1000
```

If I open AutoCAD and convert it into v2000, and try it again. I get this error:

```
Reading DWG file file2000.dwg
Warning: Unstable Class object 504 TABLESTYLE (0xfff) 34/0
Warning: Unstable Class object 505 MATERIAL (0x481) 46/0
Warning: Unstable Class object 505 MATERIAL (0x481) 47/0
Warning: Unstable Class object 505 MATERIAL (0x481) 48/0
Warning: Unstable Class object 508 MLEADERSTYLE (0xfff) 69/0
Warning: Unknown Class object 539 AT_VIEWPORTTABLEREACTOR (0x400)
Warning: Unstable Class object 551 RAPIDRTRENDERSETTINGS (0x400) 151/0
Warning: Unhandled Class object 547 ACDBASSOCPERSSUBENTMANAGER (0x400) 152/0
Warning: Unhandled Class object 548 ACDBPERSSUBENTMANAGER (0x400) 153/0
Warning: Unknown Class object 552 KS_DATARECORD (0x0)
Warning: Unknown Class object 552 KS_DATARECORD (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 554 Ks_WeldStyle (0x0)
Warning: Unknown Class object 554 Ks_WeldStyle (0x0)
Warning: Unknown Class object 554 Ks_WeldStyle (0x0)
Warning: Unknown Class object 554 Ks_WeldStyle (0x0)
Warning: Unknown Class object 555 Ks_KoteflagStyle (0x0)
Warning: Unknown Class object 555 Ks_KoteflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 557 KS_SHAPEREFERENCE (0x0)
Warning: Unknown Class object 557 KS_SHAPEREFERENCE (0x0)
Warning: Unknown Class object 552 KS_DATARECORD (0x0)
Warning: Unknown Class object 557 KS_SHAPEREFERENCE (0x0)
Warning: Unknown Class object 561 KS_HANDRAILNEWREACTOR (0x0)
Warning: Unknown Class object 557 KS_SHAPEREFERENCE (0x0)
Warning: Unknown Class object 557 KS_SHAPEREFERENCE (0x0)
ERROR: Invalid xdata type -7864 [RS]
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class object 564 KS_GROUPDATA (0x0)
Warning: Unknown Class object 561 KS_HANDRAILNEWREACTOR (0x0)
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 337/0
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 341/0
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 346/0
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 350/0
Warning: Unhandled Class object 573 ACSH_LOFT_CLASS (0x481) 351/0
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 354/0
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 357/0
killed

```
dwg 2019: Invalid comp_bytes 4 > 3 bytes left (vs 3)
This is a GitHub Issue
repo:libredwg
owner:LibreDWG
Title : dwg 2019: Invalid comp_bytes 4 > 3 bytes left (vs 3)
Issue date:

--- start body ---
I compiled libredwg for converting with dwg2dxf on a Ubuntu 23.10

If I run dwg2dxf file2019.dwg file2019.dwg
I get this Error:

```
Reading DWG file file2019.dwg
Warning: checksum: 0x2fbea88a (calculated) CRC mismatch 0x29367234-0x29398170

ERROR: 
Invalid comp_bytes 4 > 3 bytes left (vs 3)
ERROR: Failed to read R2004 Section Page Map.
ERROR: Failed to decode file: `file2019.dwg` 0x440

READ ERROR 0x440
Reading DWG file file2019.dxf
ERROR: File not found: `file2019.dxf`

READ ERROR 0x1000
```

If I open AutoCAD and convert it into v2000, and try it again. I get this error:

```
Reading DWG file file2000.dwg
Warning: Unstable Class object 504 TABLESTYLE (0xfff) 34/0
Warning: Unstable Class object 505 MATERIAL (0x481) 46/0
Warning: Unstable Class object 505 MATERIAL (0x481) 47/0
Warning: Unstable Class object 505 MATERIAL (0x481) 48/0
Warning: Unstable Class object 508 MLEADERSTYLE (0xfff) 69/0
Warning: Unknown Class object 539 AT_VIEWPORTTABLEREACTOR (0x400)
Warning: Unstable Class object 551 RAPIDRTRENDERSETTINGS (0x400) 151/0
Warning: Unhandled Class object 547 ACDBASSOCPERSSUBENTMANAGER (0x400) 152/0
Warning: Unhandled Class object 548 ACDBPERSSUBENTMANAGER (0x400) 153/0
Warning: Unknown Class object 552 KS_DATARECORD (0x0)
Warning: Unknown Class object 552 KS_DATARECORD (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 553 Ks_BoltStyle (0x0)
Warning: Unknown Class object 554 Ks_WeldStyle (0x0)
Warning: Unknown Class object 554 Ks_WeldStyle (0x0)
Warning: Unknown Class object 554 Ks_WeldStyle (0x0)
Warning: Unknown Class object 554 Ks_WeldStyle (0x0)
Warning: Unknown Class object 555 Ks_KoteflagStyle (0x0)
Warning: Unknown Class object 555 Ks_KoteflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 556 Ks_PosflagStyle (0x0)
Warning: Unknown Class object 557 KS_SHAPEREFERENCE (0x0)
Warning: Unknown Class object 557 KS_SHAPEREFERENCE (0x0)
Warning: Unknown Class object 552 KS_DATARECORD (0x0)
Warning: Unknown Class object 557 KS_SHAPEREFERENCE (0x0)
Warning: Unknown Class object 561 KS_HANDRAILNEWREACTOR (0x0)
Warning: Unknown Class object 557 KS_SHAPEREFERENCE (0x0)
Warning: Unknown Class object 557 KS_SHAPEREFERENCE (0x0)
ERROR: Invalid xdata type -7864 [RS]
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 558 KS_SHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class entity 559 KS_ARCSHAPE (0xbff)
Warning: Unknown Class object 564 KS_GROUPDATA (0x0)
Warning: Unknown Class object 561 KS_HANDRAILNEWREACTOR (0x0)
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 337/0
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 341/0
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 346/0
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 350/0
Warning: Unhandled Class object 573 ACSH_LOFT_CLASS (0x481) 351/0
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 354/0
Warning: Unstable Class object 517 ACAD_EVALUATION_GRAPH (0x481) 357/0
killed

```
--- end body ---

The issue indicates that the `dwg2dxf` tool in LibreDWG encounters an error when processing certain DWG files, specifically related to invalid compression bytes and checksum mismatches. This could potentially lead to a Denial of Service (DoS) if an attacker crafts a malicious DWG file that triggers these errors, causing the application to crash or behave unexpectedly.