@@ -2333,12 +2333,12 @@ bool DRW_Hatch::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
2333
2333
{
2334
2334
dint32 numPathSeg = buf->getBitLong ();
2335
2335
2336
- QgsDebugMsgLevel ( QStringLiteral ( " segs: %1" ).arg ( numPathSeg ), 4 );
2336
+ QgsDebugMsgLevel ( QStringLiteral ( " segs: %1" ).arg ( numPathSeg ), 4 );
2337
2337
2338
- for ( dint32 j = 0 ; j < numPathSeg; ++j )
2338
+ for ( dint32 j = 0 ; j < numPathSeg && buf-> isGood () ; ++j )
2339
2339
{
2340
2340
duint8 typePath = buf->getRawChar8 ();
2341
- QgsDebugMsgLevel ( QStringLiteral ( " typepath: %1" ).arg ( typePath ), 4 );
2341
+ QgsDebugMsgLevel ( QStringLiteral ( " typepath: %1" ).arg ( typePath ), 4 );
2342
2342
if ( typePath == 1 ) // line
2343
2343
{
2344
2344
addLine ();
@@ -2374,7 +2374,7 @@ bool DRW_Hatch::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
2374
2374
spline->nknots = buf->getBitLong ();
2375
2375
spline->ncontrol = buf->getBitLong ();
2376
2376
2377
- QgsDebugMsgLevel ( QStringLiteral ( " degree:%1 flags:0x%2 nknots:%3 ncontrol:%4" )
2377
+ QgsDebugMsgLevel ( QStringLiteral ( " degree:%1 flags:0x%2 nknots:%3 ncontrol:%4" )
2378
2378
.arg ( spline->degree ).arg ( spline->flags , 0 , 16 )
2379
2379
.arg ( spline->nknots ).arg ( spline->ncontrol ), 4
2380
2380
);
@@ -2384,7 +2384,7 @@ bool DRW_Hatch::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
2384
2384
for ( j = 0 ; j < spline->nknots && buf->isGood (); ++j )
2385
2385
{
2386
2386
spline->knotslist .push_back ( buf->getBitDouble () );
2387
- QgsDebugMsgLevel ( QStringLiteral ( " knot %1: %2" ).arg ( j )
2387
+ QgsDebugMsgLevel ( QStringLiteral ( " knot %1: %2" ).arg ( j )
2388
2388
.arg ( spline->knotslist .back () ), 4
2389
2389
);
2390
2390
}
@@ -2406,22 +2406,22 @@ bool DRW_Hatch::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
2406
2406
if ( isRational )
2407
2407
crd->z = buf->getBitDouble (); // RLZ: investigate how store weight
2408
2408
spline->controllist .push_back ( crd );
2409
- QgsDebugMsgLevel ( QStringLiteral ( " control %1: %2" )
2409
+ QgsDebugMsgLevel ( QStringLiteral ( " control %1: %2" )
2410
2410
.arg ( j )
2411
2411
.arg ( QStringLiteral ( " %1,%2,%3" ).arg ( crd->x ).arg ( crd->y ).arg ( crd->z ) ), 4
2412
2412
);
2413
2413
}
2414
2414
if ( version > DRW::AC1021 ) // 2010+
2415
2415
{
2416
2416
spline->nfit = buf->getBitLong ();
2417
- QgsDebugMsgLevel ( QStringLiteral ( " nfit:%1" ).arg ( spline->nfit ), 4 );
2417
+ QgsDebugMsgLevel ( QStringLiteral ( " nfit:%1" ).arg ( spline->nfit ), 4 );
2418
2418
RESERVE ( spline->fitlist , spline->nfit );
2419
2419
for ( dint32 j = 0 ; j < spline->nfit && buf->isGood (); ++j )
2420
2420
{
2421
2421
DRW_Coord *crd = new DRW_Coord ( buf->get2RawDouble () );
2422
2422
spline->fitlist .push_back ( crd );
2423
2423
2424
- QgsDebugMsgLevel ( QStringLiteral ( " fit %1: %2" )
2424
+ QgsDebugMsgLevel ( QStringLiteral ( " fit %1: %2" )
2425
2425
.arg ( j )
2426
2426
.arg ( QStringLiteral ( " %1,%2,%3" ).arg ( crd->x ).arg ( crd->y ).arg ( crd->z ) ), 4
2427
2427
);
@@ -2439,7 +2439,7 @@ bool DRW_Hatch::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
2439
2439
pline->flags = buf->getBit ();// closed bit
2440
2440
dint32 numVert = buf->getBitLong ();
2441
2441
2442
- QgsDebugMsgLevel ( QStringLiteral ( " hasBulge:%1 flags:%2 verts:%3" )
2442
+ QgsDebugMsgLevel ( QStringLiteral ( " hasBulge:%1 flags:%2 verts:%3" )
2443
2443
.arg ( hasBulges ).arg ( pline->flags , 0 , 16 ).arg ( numVert ), 4
2444
2444
);
2445
2445
0 commit comments