Skip to content

Commit

Permalink
masks: avoid assertion failure in early phase of path generation
Browse files Browse the repository at this point in the history
  • Loading branch information
upegelow committed Feb 17, 2017
1 parent c773a18 commit 6d2e360
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/develop/masks/path.c
Expand Up @@ -342,6 +342,8 @@ static void _path_points_recurs(float *p1, float *p2, double tmin, double tmax,
/** find all self intersections in a path */
static int _path_find_self_intersection(dt_masks_dynbuf_t *inter, int nb_corners, float *border, int border_count)
{
if(nb_corners == 0 || border_count == 0) return 0;

int inter_count = 0;

// we search extreme points in x and y
Expand Down Expand Up @@ -526,7 +528,7 @@ static int _path_get_points_border(dt_develop_t *dev, dt_masks_form_t *form, int
}
}

intersections = dt_masks_dynbuf_init(10 * nb, "path intersections");
intersections = dt_masks_dynbuf_init(10 * MAX(nb, 1), "path intersections");
if(intersections == NULL)
{
dt_masks_dynbuf_free(dpoints);
Expand Down

0 comments on commit 6d2e360

Please sign in to comment.