Skip to content

Commit

Permalink
image: Use correct size for allocation
Browse files Browse the repository at this point in the history
In 06e9caf the type of the variables
was changed, but the type used to compute the allocation size was not.

Fixes a crash in user-font-mask (test-fallback backend).
(cherry picked from commit c7027c9)
  • Loading branch information
Andrea Canciani authored and Chris Wilson committed Nov 2, 2010
1 parent 83259f6 commit 91a6fe6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cairo-image-surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -4252,7 +4252,7 @@ _cairo_image_surface_fill_rectangles (void *abstract_surface,
cairo_image_surface_t *surface = abstract_surface;

pixman_color_t pixman_color;
pixman_box32_t stack_boxes[CAIRO_STACK_ARRAY_LENGTH (pixman_rectangle16_t)];
pixman_box32_t stack_boxes[CAIRO_STACK_ARRAY_LENGTH (pixman_box32_t)];
pixman_box32_t *pixman_boxes = stack_boxes;
int i;

Expand All @@ -4267,7 +4267,7 @@ _cairo_image_surface_fill_rectangles (void *abstract_surface,
pixman_color.alpha = color->alpha_short;

if (num_rects > ARRAY_LENGTH (stack_boxes)) {
pixman_boxes = _cairo_malloc_ab (num_rects, sizeof (pixman_rectangle16_t));
pixman_boxes = _cairo_malloc_ab (num_rects, sizeof (pixman_box32_t));
if (unlikely (pixman_boxes == NULL))
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
}
Expand Down

0 comments on commit 91a6fe6

Please sign in to comment.