diff options
Diffstat (limited to 'draw')
-rw-r--r-- | draw/draw_edge.c | 8 | ||||
-rw-r--r-- | draw/draw_scale.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/draw/draw_edge.c b/draw/draw_edge.c index ee218bc9..d9372cfb 100644 --- a/draw/draw_edge.c +++ b/draw/draw_edge.c @@ -139,7 +139,7 @@ fz_new_gel(fz_context *ctx) gel->ctx = ctx; gel->cap = 512; gel->len = 0; - gel->edges = fz_calloc(ctx, gel->cap, sizeof(fz_edge)); + gel->edges = fz_malloc_array(ctx, gel->cap, sizeof(fz_edge)); gel->clip.x0 = gel->clip.y0 = BBOX_MAX; gel->clip.x1 = gel->clip.y1 = BBOX_MIN; @@ -149,7 +149,7 @@ fz_new_gel(fz_context *ctx) gel->acap = 64; gel->alen = 0; - gel->active = fz_calloc(ctx, gel->acap, sizeof(fz_edge*)); + gel->active = fz_malloc_array(ctx, gel->acap, sizeof(fz_edge*)); return gel; } @@ -255,7 +255,7 @@ fz_insert_gel_raw(fz_gel *gel, int x0, int y0, int x1, int y1) if (gel->len + 1 == gel->cap) { gel->cap = gel->cap + 512; - gel->edges = fz_realloc(gel->ctx, gel->edges, gel->cap * sizeof(fz_edge)); + gel->edges = fz_resize_array(gel->ctx, gel->edges, gel->cap, sizeof(fz_edge)); } edge = &gel->edges[gel->len++]; @@ -445,7 +445,7 @@ insert_active(fz_gel *gel, int y, int *e) while (*e < gel->len && gel->edges[*e].y == y) { if (gel->alen + 1 == gel->acap) { int newcap = gel->acap + 64; - fz_edge **newactive = fz_realloc(gel->ctx, gel->active, newcap * sizeof(fz_edge*)); + fz_edge **newactive = fz_resize_array(gel->ctx, gel->active, newcap, sizeof(fz_edge*)); gel->active = newactive; gel->acap = newcap; } diff --git a/draw/draw_scale.c b/draw/draw_scale.c index 045de810..4d1b66c5 100644 --- a/draw/draw_scale.c +++ b/draw/draw_scale.c @@ -1199,7 +1199,7 @@ fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, floa temp_rows = contrib_rows->max_len; if (temp_span <= 0 || temp_rows > INT_MAX / temp_span) goto cleanup; - temp = fz_calloc(ctx, temp_span*temp_rows, sizeof(int)); + temp = fz_malloc_array(ctx, temp_span*temp_rows, sizeof(int)); if (temp == NULL) goto cleanup; switch (src->n) |