Skip to content

dwg_convert_SAB_to_SAT1 meybe have a bug #1184

@Dylan-H

Description

@Dylan-H

I used dwg2dxf for testing.
testfile: libredwg\test\test-data\example_2007.dwg
In the following code of the function dwg_convert_SAB_to_SAT1

case 14: // subident
          {
            int len = bit_read_RC (&src);
            if (len == 0)
              return 0;
            if (src.byte + len >= src.size)  // Will enter this condition
              {
                LOG_ERROR ("Invalid SAB len=%d [RC]", len);
                bit_chain_free (&dest);
                _obj->num_blocks = 0;
                _obj->encr_sat_data[0] = NULL;
                return 1;
              }

But at this time, the correct data has actually been solved.
dest.chain:
“21200 0 2 0
16 Autodesk AutoCAD 20 ASM 223.0.1.1930 OSX 24 Mon Jun 18 11:09:39 2018
1 1e-06 1e-10
asmheader $-1 $-1 12 223.0.1.1930 #
body $-1 $-1 $-1 $2 $-1 $-1 #
lump $-1 $-1 $-1 $-1 $3 $1 #
shell $-1 $-1 $-1 $-1 $-1 $4 $-1 $2 #
face $-1 $-1 $-1 $-1 $5 $3 $-1 $6 forward double out #
loop $-1 $-1 $-1 $-1 $7 $4 #
plane-surface $-1 $-1 $-1 -5234.19 1968.77 0 0 0 1 1 0 0 F F F F F #
coedge $-1 $-1 $-1 $8 $9 $-1 $10 I $5 $-1 #
coedge $-1 $-1 $-1 $11 $7 $-1 $12 I $5 $-1 #
coedge $-1 $-1 $-1 $7 $11 $-1 $13 I $5 $-1 #
edge $-1 $-1 $-1 $14 0 $15 3204.29 $7 $16 forward 7 unknown #
coedge $-1 $-1 $-1 $9 $8 $-1 $17 I $5 $-1 #
edge $-1 $-1 $-1 $18 0 $14 4029.15 $8 $19 forward 7 unknown #
edge $-1 $-1 $-1 $15 0 $20 4029.15 $9 $21 forward 7 unknown #
vertex $-1 $-1 $-1 $10 $2 $22 #
vertex $-1 $-1 $-1 $10 $2 $23 #
straight-curve $-1 $-1 $-1 -6836.33 3983.34 0 1 0 0 F F #
edge $-1 $-1 $-1 $20 0 $18 3204.29 $11 $24 forward 7 unknown #
vertex $-1 $-1 $-1 $17 $2 $25 #
straight-curve $-1 $-1 $-1 -6836.33 -45.8078 0 0 1 0 F F #
vertex $-1 $-1 $-1 $13 $2 $26 #
straight-curve $-1 $-1 $-1 -3632.04 3983.34 0 0 -1 0 F F #
point $-1 $-1 $-1 -6836.33 3983.34 0 #
point $-1 $-1 $-1 -3632.04 3983.34 0 #
straight-curve $-1 $-1 $-1 -3632.04 -45.8078 0 -1 0 0 F F #
point $-1 $-1 $-1 -6836.33 -45.8078 0 #
point $-1 $-1 $-1 -3632.04 -45.8078 0 #
End-of-ACIS-”
Maybe src.size is missing a byte

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions