summaryrefslogtreecommitdiff
path: root/app/bin/compound.c
diff options
context:
space:
mode:
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 );