summaryrefslogtreecommitdiff
path: root/app/bin/compound.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-05 18:22:19 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-05 18:22:19 +0200
commit498011c44291d7d619143ce5ff3e38369d759c22 (patch)
tree5b4d1fdd686089c0c1778a462e27fa694b8f49be /app/bin/compound.c
parent67d0ce65dc6a1d240e271a7cd479b60aa1dc2967 (diff)
parent9a1d6eded2750572e9f5f79e53ec507dd7a06ba5 (diff)
Update upstream source from tag 'upstream/5.1.1'
Update to upstream version '5.1.1' with Debian dir 878f8cb06af8c1037570ac8774f9261ff9b12fa4
Diffstat (limited to 'app/bin/compound.c')
-rw-r--r--app/bin/compound.c7
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 );