Hello,

I am attaching a new file that causes the following segfault with ASAN enabled on dwgread:

[0.zip](https://github.com/LibreDWG/libredwg/files/11186172/0.zip)

This was tested on x86 Debian 11 vm.

```
=================================================================
==1738==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb09014d0 at pc 0xb301276d bp 0xbf9e3b08 sp 0xbf9e3afc
WRITE of size 2 at 0xb09014d0 thread T0
    #0 0xb301276c in bit_read_T32 /home/user/gcc/libredwg/src/bits.c:2248
    #1 0xb34cbf66 in filedeplist_private /home/user/gcc/libredwg/src/filedeplist.spec:29
    #2 0xb34cbf66 in read_2004_section_filedeplist /home/user/gcc/libredwg/src/decode.c:2759
    #3 0xb34cbf66 in decode_R2004 /home/user/gcc/libredwg/src/decode.c:3414
    #4 0xb34d2c31 in dwg_decode /home/user/gcc/libredwg/src/decode.c:231
    #5 0xb3544642 in dwg_read_file /home/user/gcc/libredwg/src/dwg.c:261
    #6 0x49b71e in main /home/user/gcc/libredwg/programs/dwgread.c:256
    #7 0xb77fee45 in __libc_start_main ../csu/libc-start.c:308
    #8 0x49cf00 in _start (/home/user/gcc/libredwg/dwgread+0x4f00)

0xb09014d1 is located 0 bytes to the right of 1-byte region [0xb09014d0,0xb09014d1)
allocated by thread T0 here:
    #0 0xb7a794bb in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0xb3012655 in bit_read_T32 /home/user/gcc/libredwg/src/bits.c:2240

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/user/gcc/libredwg/src/bits.c:2248 in bit_read_T32
Shadow bytes around the buggy address:
  0x36120240: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36120250: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36120260: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36120270: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36120280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x36120290: fa fa fa fa fa fa fa fa fa fa[01]fa fa fa 02 fa
  0x361202a0: fa fa 00 00 fa fa 02 fa fa fa 02 fa fa fa 02 fa
  0x361202b0: fa fa 02 fa fa fa 02 fa fa fa 02 fa fa fa 00 04
  0x361202c0: fa fa 00 06 fa fa fd fd fa fa 00 02 fa fa fd fd
  0x361202d0: fa fa 00 00 fa fa 00 06 fa fa fd fd fa fa 00 07
  0x361202e0: fa fa fd fd fa fa 00 03 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
  Shadow gap:              cc
==1738==ABORTING

```

AddressSanitizer: heap-buffer-overflow on bit_read_T32 libredwg/src/bits.c:2248
This is a GitHub Issue
repo:libredwg
owner:LibreDWG
Title : AddressSanitizer: heap-buffer-overflow on bit_read_T32 libredwg/src/bits.c:2248
Issue date:

--- start body ---
Hello,

I am attaching a new file that causes the following segfault with ASAN enabled on dwgread:

[0.zip](https://github.com/LibreDWG/libredwg/files/11186172/0.zip)

This was tested on x86 Debian 11 vm.

```
=================================================================
==1738==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb09014d0 at pc 0xb301276d bp 0xbf9e3b08 sp 0xbf9e3afc
WRITE of size 2 at 0xb09014d0 thread T0
    #0 0xb301276c in bit_read_T32 /home/user/gcc/libredwg/src/bits.c:2248
    #1 0xb34cbf66 in filedeplist_private /home/user/gcc/libredwg/src/filedeplist.spec:29
    #2 0xb34cbf66 in read_2004_section_filedeplist /home/user/gcc/libredwg/src/decode.c:2759
    #3 0xb34cbf66 in decode_R2004 /home/user/gcc/libredwg/src/decode.c:3414
    #4 0xb34d2c31 in dwg_decode /home/user/gcc/libredwg/src/decode.c:231
    #5 0xb3544642 in dwg_read_file /home/user/gcc/libredwg/src/dwg.c:261
    #6 0x49b71e in main /home/user/gcc/libredwg/programs/dwgread.c:256
    #7 0xb77fee45 in __libc_start_main ../csu/libc-start.c:308
    #8 0x49cf00 in _start (/home/user/gcc/libredwg/dwgread+0x4f00)

0xb09014d1 is located 0 bytes to the right of 1-byte region [0xb09014d0,0xb09014d1)
allocated by thread T0 here:
    #0 0xb7a794bb in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0xb3012655 in bit_read_T32 /home/user/gcc/libredwg/src/bits.c:2240

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/user/gcc/libredwg/src/bits.c:2248 in bit_read_T32
Shadow bytes around the buggy address:
  0x36120240: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36120250: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36120260: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36120270: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36120280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x36120290: fa fa fa fa fa fa fa fa fa fa[01]fa fa fa 02 fa
  0x361202a0: fa fa 00 00 fa fa 02 fa fa fa 02 fa fa fa 02 fa
  0x361202b0: fa fa 02 fa fa fa 02 fa fa fa 02 fa fa fa 00 04
  0x361202c0: fa fa 00 06 fa fa fd fd fa fa 00 02 fa fa fd fd
  0x361202d0: fa fa 00 00 fa fa 00 06 fa fa fd fd fa fa 00 07
  0x361202e0: fa fa fd fd fa fa 00 03 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
  Shadow gap:              cc
==1738==ABORTING

```

--- end body ---

A heap-buffer-overflow vulnerability in the bit_read_T32 function of LibreDWG allows attackers to potentially exploit memory corruption issues, leading to crashes or arbitrary code execution. This issue is triggered when processing certain DWG files, as indicated by the AddressSanitizer output.