@@ -2333,12 +2333,12 @@ bool DRW_Hatch::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
23332333 {
23342334 dint32 numPathSeg = buf->getBitLong ();
23352335
2336- QgsDebugMsgLevel ( QStringLiteral ( " segs: %1" ).arg ( numPathSeg ), 4 );
2336+ QgsDebugMsgLevel ( QStringLiteral ( " segs: %1" ).arg ( numPathSeg ), 4 );
23372337
2338- for ( dint32 j = 0 ; j < numPathSeg; ++j )
2338+ for ( dint32 j = 0 ; j < numPathSeg && buf-> isGood () ; ++j )
23392339 {
23402340 duint8 typePath = buf->getRawChar8 ();
2341- QgsDebugMsgLevel ( QStringLiteral ( " typepath: %1" ).arg ( typePath ), 4 );
2341+ QgsDebugMsgLevel ( QStringLiteral ( " typepath: %1" ).arg ( typePath ), 4 );
23422342 if ( typePath == 1 ) // line
23432343 {
23442344 addLine ();
@@ -2374,7 +2374,7 @@ bool DRW_Hatch::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
23742374 spline->nknots = buf->getBitLong ();
23752375 spline->ncontrol = buf->getBitLong ();
23762376
2377- QgsDebugMsgLevel ( QStringLiteral ( " degree:%1 flags:0x%2 nknots:%3 ncontrol:%4" )
2377+ QgsDebugMsgLevel ( QStringLiteral ( " degree:%1 flags:0x%2 nknots:%3 ncontrol:%4" )
23782378 .arg ( spline->degree ).arg ( spline->flags , 0 , 16 )
23792379 .arg ( spline->nknots ).arg ( spline->ncontrol ), 4
23802380 );
@@ -2384,7 +2384,7 @@ bool DRW_Hatch::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
23842384 for ( j = 0 ; j < spline->nknots && buf->isGood (); ++j )
23852385 {
23862386 spline->knotslist .push_back ( buf->getBitDouble () );
2387- QgsDebugMsgLevel ( QStringLiteral ( " knot %1: %2" ).arg ( j )
2387+ QgsDebugMsgLevel ( QStringLiteral ( " knot %1: %2" ).arg ( j )
23882388 .arg ( spline->knotslist .back () ), 4
23892389 );
23902390 }
@@ -2406,22 +2406,22 @@ bool DRW_Hatch::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
24062406 if ( isRational )
24072407 crd->z = buf->getBitDouble (); // RLZ: investigate how store weight
24082408 spline->controllist .push_back ( crd );
2409- QgsDebugMsgLevel ( QStringLiteral ( " control %1: %2" )
2409+ QgsDebugMsgLevel ( QStringLiteral ( " control %1: %2" )
24102410 .arg ( j )
24112411 .arg ( QStringLiteral ( " %1,%2,%3" ).arg ( crd->x ).arg ( crd->y ).arg ( crd->z ) ), 4
24122412 );
24132413 }
24142414 if ( version > DRW::AC1021 ) // 2010+
24152415 {
24162416 spline->nfit = buf->getBitLong ();
2417- QgsDebugMsgLevel ( QStringLiteral ( " nfit:%1" ).arg ( spline->nfit ), 4 );
2417+ QgsDebugMsgLevel ( QStringLiteral ( " nfit:%1" ).arg ( spline->nfit ), 4 );
24182418 RESERVE ( spline->fitlist , spline->nfit );
24192419 for ( dint32 j = 0 ; j < spline->nfit && buf->isGood (); ++j )
24202420 {
24212421 DRW_Coord *crd = new DRW_Coord ( buf->get2RawDouble () );
24222422 spline->fitlist .push_back ( crd );
24232423
2424- QgsDebugMsgLevel ( QStringLiteral ( " fit %1: %2" )
2424+ QgsDebugMsgLevel ( QStringLiteral ( " fit %1: %2" )
24252425 .arg ( j )
24262426 .arg ( QStringLiteral ( " %1,%2,%3" ).arg ( crd->x ).arg ( crd->y ).arg ( crd->z ) ), 4
24272427 );
@@ -2439,7 +2439,7 @@ bool DRW_Hatch::parseDwg( DRW::Version version, dwgBuffer *buf, duint32 bs )
24392439 pline->flags = buf->getBit ();// closed bit
24402440 dint32 numVert = buf->getBitLong ();
24412441
2442- QgsDebugMsgLevel ( QStringLiteral ( " hasBulge:%1 flags:%2 verts:%3" )
2442+ QgsDebugMsgLevel ( QStringLiteral ( " hasBulge:%1 flags:%2 verts:%3" )
24432443 .arg ( hasBulges ).arg ( pline->flags , 0 , 16 ).arg ( numVert ), 4
24442444 );
24452445
0 commit comments