[cairo] More hb_malloc

This commit is contained in:
Behdad Esfahbod 2023-01-25 15:24:14 -07:00
parent 57352b8bd4
commit 5b05e198cf
1 changed files with 4 additions and 4 deletions

View File

@ -343,7 +343,7 @@ _hb_cairo_paint_radial_gradient (hb_cairo_context_t *c,
len = hb_color_line_get_color_stops (color_line, 0, nullptr, nullptr); len = hb_color_line_get_color_stops (color_line, 0, nullptr, nullptr);
if (len > PREALLOCATED_COLOR_STOPS) if (len > PREALLOCATED_COLOR_STOPS)
stops = (hb_color_stop_t *) malloc (len * sizeof (hb_color_stop_t)); stops = (hb_color_stop_t *) hb_malloc (len * sizeof (hb_color_stop_t));
hb_color_line_get_color_stops (color_line, 0, &len, stops); hb_color_line_get_color_stops (color_line, 0, &len, stops);
_hb_cairo_normalize_color_line (stops, len, &min, &max); _hb_cairo_normalize_color_line (stops, len, &min, &max);
@ -602,8 +602,8 @@ _hb_cairo_add_sweep_gradient_patches (hb_color_stop_t *stops,
if (n_stops > PREALLOCATED_COLOR_STOPS) if (n_stops > PREALLOCATED_COLOR_STOPS)
{ {
angles = (float *) malloc (sizeof (float) * n_stops); angles = (float *) hb_malloc (sizeof (float) * n_stops);
colors = (hb_cairo_color_t *) malloc (sizeof (hb_cairo_color_t) * n_stops); colors = (hb_cairo_color_t *) hb_malloc (sizeof (hb_cairo_color_t) * n_stops);
} }
for (unsigned i = 0; i < n_stops; i++) for (unsigned i = 0; i < n_stops; i++)
@ -808,7 +808,7 @@ _hb_cairo_paint_sweep_gradient (hb_cairo_context_t *c,
len = hb_color_line_get_color_stops (color_line, 0, nullptr, nullptr); len = hb_color_line_get_color_stops (color_line, 0, nullptr, nullptr);
if (len > PREALLOCATED_COLOR_STOPS) if (len > PREALLOCATED_COLOR_STOPS)
stops = (hb_color_stop_t *) malloc (len * sizeof (hb_color_stop_t)); stops = (hb_color_stop_t *) hb_malloc (len * sizeof (hb_color_stop_t));
hb_color_line_get_color_stops (color_line, 0, &len, stops); hb_color_line_get_color_stops (color_line, 0, &len, stops);
hb_qsort (stops, len, sizeof (hb_color_stop_t), _hb_cairo_cmp_color_stop); hb_qsort (stops, len, sizeof (hb_color_stop_t), _hb_cairo_cmp_color_stop);