diff --git a/glamor/glamor_compositerects.c b/glamor/glamor_compositerects.c index f245cf69a..dfd950d23 100644 --- a/glamor/glamor_compositerects.c +++ b/glamor/glamor_compositerects.c @@ -58,7 +58,7 @@ _pixman_region_init_clipped_rectangles(pixman_region16_t * region, unsigned int i, j; if (num_rects > ARRAY_SIZE(stack_boxes)) { - boxes = xallocarray(num_rects, sizeof(pixman_box16_t)); + boxes = calloc(num_rects, sizeof(pixman_box16_t)); if (boxes == NULL) return FALSE; } diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c index fb41bddf3..49777bdab 100644 --- a/glamor/glamor_gradient.c +++ b/glamor/glamor_gradient.c @@ -990,13 +990,13 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, /* Set all the stops and colors to shader. */ if (stops_count > RADIAL_SMALL_STOPS) { - stop_colors = xallocarray(stops_count, 4 * sizeof(float)); + stop_colors = calloc(stops_count, 4 * sizeof(float)); if (stop_colors == NULL) { ErrorF("Failed to allocate stop_colors memory.\n"); goto GRADIENT_FAIL; } - n_stops = xallocarray(stops_count, sizeof(float)); + n_stops = calloc(stops_count, sizeof(float)); if (n_stops == NULL) { ErrorF("Failed to allocate n_stops memory.\n"); goto GRADIENT_FAIL; @@ -1328,13 +1328,13 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, /* Set all the stops and colors to shader. */ if (stops_count > LINEAR_SMALL_STOPS) { - stop_colors = xallocarray(stops_count, 4 * sizeof(float)); + stop_colors = calloc(stops_count, 4 * sizeof(float)); if (stop_colors == NULL) { ErrorF("Failed to allocate stop_colors memory.\n"); goto GRADIENT_FAIL; } - n_stops = xallocarray(stops_count, sizeof(float)); + n_stops = calloc(stops_count, sizeof(float)); if (n_stops == NULL) { ErrorF("Failed to allocate n_stops memory.\n"); goto GRADIENT_FAIL; diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c index 8112cbcf4..b186c999a 100644 --- a/glamor/glamor_prepare.c +++ b/glamor/glamor_prepare.c @@ -123,8 +123,8 @@ glamor_prep_drawable_box(DrawablePtr drawable, glamor_access_t access, BoxPtr bo } if (!priv->pbo) { - pixmap->devPrivate.ptr = xallocarray(pixmap->devKind, - pixmap->drawable.height); + pixmap->devPrivate.ptr = calloc(pixmap->devKind, + pixmap->drawable.height); if (!pixmap->devPrivate.ptr) return FALSE; } diff --git a/glamor/glamor_utils.c b/glamor/glamor_utils.c index 23445137e..ec32aa229 100644 --- a/glamor/glamor_utils.c +++ b/glamor/glamor_utils.c @@ -31,7 +31,7 @@ glamor_solid_boxes(DrawablePtr drawable, xRectangle *rect; int n; - rect = xallocarray(nbox, sizeof(xRectangle)); + rect = calloc(nbox, sizeof(xRectangle)); if (!rect) return; for (n = 0; n < nbox; n++) {