diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-05 18:22:00 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-05-05 18:22:00 +0200 |
commit | 9a1d6eded2750572e9f5f79e53ec507dd7a06ba5 (patch) | |
tree | 10d84c82031aace7ac819f27116a04e7da238d59 /app/bin/compound.c | |
parent | d1a8285f818eb7e5c3d6a05709ea21a808490b8c (diff) |
New upstream version 5.1.1upstream/5.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 ); |