use malloc for point arrays since they are filled in immediately.
This commit is contained in:
@@ -57,6 +57,7 @@ void BKE_mask_object_unique_name(struct Mask *mask, struct MaskObject *maskobj);
|
||||
/* splines */
|
||||
struct MaskSpline *BKE_mask_spline_add(struct MaskObject *maskobj);
|
||||
int BKE_mask_spline_resolution(struct MaskSpline *spline);
|
||||
|
||||
float (*BKE_mask_spline_differentiate(struct MaskSpline *spline, int *tot_diff_point))[2];
|
||||
float (*BKE_mask_spline_feather_differentiated_points(struct MaskSpline *spline, int *tot_feather_point))[2];
|
||||
float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2];
|
||||
|
||||
@@ -240,7 +240,7 @@ float (*BKE_mask_spline_differentiate(MaskSpline *spline, int *tot_diff_point))[
|
||||
|
||||
/* len+1 because of 'forward_diff_bezier' function */
|
||||
*tot_diff_point = len;
|
||||
diff_points = fp = MEM_callocN((len + 1) * sizeof(*diff_points), "mask spline vets");
|
||||
diff_points = fp = MEM_mallocN((len + 1) * sizeof(*diff_points), "mask spline vets");
|
||||
|
||||
a = spline->tot_point - 1;
|
||||
if (spline->flag & MASK_SPLINE_CYCLIC)
|
||||
@@ -287,7 +287,7 @@ float (*BKE_mask_spline_feather_differentiated_points(MaskSpline *spline, int *t
|
||||
int i, j, tot, resol = BKE_mask_spline_feather_resolution(spline);
|
||||
|
||||
tot = resol * spline->tot_point;
|
||||
feather = fp = MEM_callocN(tot * sizeof(*feather), "mask spline feather diff points");
|
||||
feather = fp = MEM_mallocN(tot * sizeof(*feather), "mask spline feather diff points");
|
||||
|
||||
for (i = 0; i < spline->tot_point; i++) {
|
||||
MaskSplinePoint *point = &points_array[i];
|
||||
@@ -326,7 +326,7 @@ float (*BKE_mask_spline_feather_points(MaskSpline *spline, int *tot_feather_poin
|
||||
}
|
||||
|
||||
/* create data */
|
||||
feather = fp = MEM_callocN(tot * sizeof(*feather), "mask spline feather points");
|
||||
feather = fp = MEM_mallocN(tot * sizeof(*feather), "mask spline feather points");
|
||||
|
||||
for (i = 0; i < spline->tot_point; i++) {
|
||||
MaskSplinePoint *point = &points_array[i];
|
||||
|
||||
Reference in New Issue
Block a user