diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-07-10 23:05:17 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-07-10 23:05:17 +0200 |
commit | c120c7bcbcf115ecc2a6668f4c7f45b3d4a5bc86 (patch) | |
tree | 5550610553d1b1d7236d052b6e956b22e0bb4883 /app/bin/compound.c | |
parent | 67d0ce65dc6a1d240e271a7cd479b60aa1dc2967 (diff) | |
parent | 26d299964db18cb71c2c6a5be4864479ba82d54f (diff) |
Merge branch 'release/debian/5.1.1-1'debian/5.1.1-1
Diffstat (limited to 'app/bin/compound.c')
-rw-r--r-- | app/bin/compound.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/bin/compound.c b/app/bin/compound.c index 972ff82..dad7dda 100644 --- a/app/bin/compound.c +++ b/app/bin/compound.c @@ -522,7 +522,7 @@ static descData_t compoundDesc[] = { /*SC*/ { DESC_LONG, N_("# Segments"), &compoundData.segCnt }, /*LY*/ { DESC_LAYER, N_("Layer"), &compoundData.layerNumber }, { DESC_NULL } }; - +#define MAX_DESCRIBE_ENDS 4 static void UpdateCompound( track_p trk, int inx, descData_p descUpd, BOOL_T needUndoStart ) @@ -682,7 +682,7 @@ static void UpdateCompound( track_p trk, int inx, descData_p descUpd, BOOL_T nee case E3: case AN: case OR: - for (int i=0;i<compoundData.epCnt;i++) { + for (int i=0;(i<compoundData.epCnt)&&(i<MAX_DESCRIBE_ENDS);i++) { compoundData.endPt[i] = GetTrkEndPos(trk,i); compoundDesc[i*(E1-E0)+E0].mode |= DESC_CHANGE; trackParams_t params; @@ -803,7 +803,7 @@ void DescribeCompound( compoundDesc[SC].mode = DESC_RO; compoundDesc[LY].mode = DESC_NOREDRAW; if (compoundData.epCnt >0) { - for (int i=0;i<compoundData.epCnt;i++) { + for (int i=0;(i<compoundData.epCnt)&&(i<MAX_DESCRIBE_ENDS);i++) { compoundDesc[A0+(E1-E0)*i].mode = (int)mode; compoundDesc[R0+(E1-E0)*i].mode = DESC_RO; compoundDesc[C0+(E1-E0)*i].mode = DESC_RO; @@ -952,6 +952,7 @@ EXPORT track_p NewCompound( xx->segCnt = segCnt; xx->segs = memdup( segs, segCnt * sizeof *segs ); trkSeg_p p = xx->segs; + CopyPoly(xx->segs, xx->segCnt); FixUpBezierSegs(xx->segs,xx->segCnt); ComputeCompoundBoundingBox( trk ); SetDescriptionOrig( trk ); |