summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cairo-glitz-surface.c24
-rw-r--r--src/cairo-gstate.c8
-rw-r--r--src/cairo-hash.c6
-rw-r--r--src/cairo-hull.c2
-rw-r--r--src/cairo-image-surface.c12
-rw-r--r--src/cairo-lzw.c4
-rw-r--r--src/cairo-meta-surface.c10
7 files changed, 34 insertions, 32 deletions
diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c
index 5e68fc7a..4d781cfc 100644
--- a/src/cairo-glitz-surface.c
+++ b/src/cairo-glitz-surface.c
@@ -166,7 +166,7 @@ _cairo_glitz_get_boxes_from_region (cairo_region_t *region, int *nboxes)
gboxes = _cairo_malloc_ab (n, sizeof(glitz_box_t));
if (gboxes == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
goto done;
}
@@ -272,14 +272,14 @@ _cairo_glitz_surface_get_image (cairo_glitz_surface_t *surface,
pixels = _cairo_malloc_ab (height, pf.bytes_per_line);
if (!pixels) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
buffer = glitz_buffer_create_for_data (pixels);
if (!buffer) {
free (pixels);
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -781,7 +781,7 @@ _cairo_glitz_pattern_acquire_surface (cairo_pattern_t *pattern,
}
if (!data) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -793,7 +793,7 @@ _cairo_glitz_pattern_acquire_surface (cairo_pattern_t *pattern,
if (!buffer)
{
free (data);
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -1312,7 +1312,7 @@ _cairo_glitz_surface_composite_trapezoids (cairo_operator_t op,
&attributes);
if (src_pattern == &tmp_src_pattern.base)
_cairo_pattern_fini (&tmp_src_pattern.base);
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -1326,7 +1326,7 @@ _cairo_glitz_surface_composite_trapezoids (cairo_operator_t op,
&attributes);
if (src_pattern == &tmp_src_pattern.base)
_cairo_pattern_fini (&tmp_src_pattern.base);
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
}
@@ -1363,7 +1363,7 @@ _cairo_glitz_surface_composite_trapezoids (cairo_operator_t op,
_cairo_glitz_pattern_release_surface (src_pattern, src, &attributes);
if (src_pattern == &tmp_src_pattern.base)
_cairo_pattern_fini (&tmp_src_pattern.base);
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -1577,7 +1577,7 @@ _cairo_glitz_area_create (cairo_glitz_root_area_t *root,
area = malloc (sizeof (cairo_glitz_area_t));
if (!area) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return NULL;
}
@@ -1914,7 +1914,7 @@ _cairo_glitz_surface_font_init (cairo_glitz_surface_t *surface,
font_private = malloc (sizeof (cairo_glitz_surface_font_private_t));
if (!font_private) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -2002,7 +2002,7 @@ _cairo_glitz_surface_add_glyph (cairo_glitz_surface_t *surface,
{
glyph_private = malloc (sizeof (cairo_glitz_surface_glyph_private_t));
if (!glyph_private) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -2169,7 +2169,7 @@ _cairo_glitz_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font,
data = malloc (size1 + size2);
if (!data) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
goto FAIL1;
}
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index 32d02e58..4097a650 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -208,7 +208,7 @@ _cairo_gstate_clone (cairo_gstate_t *other)
gstate = malloc (sizeof (cairo_gstate_t));
if (gstate == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return NULL;
}
@@ -535,7 +535,7 @@ _cairo_gstate_set_dash (cairo_gstate_t *gstate, const double *dash, int num_dash
gstate->stroke_style.dash = _cairo_malloc_ab (gstate->stroke_style.num_dashes, sizeof (double));
if (gstate->stroke_style.dash == NULL) {
gstate->stroke_style.num_dashes = 0;
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -1577,7 +1577,7 @@ _cairo_gstate_show_glyphs (cairo_gstate_t *gstate,
} else {
transformed_glyphs = _cairo_malloc_ab (num_glyphs, sizeof(cairo_glyph_t));
if (transformed_glyphs == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
}
@@ -1624,7 +1624,7 @@ _cairo_gstate_glyph_path (cairo_gstate_t *gstate,
else
transformed_glyphs = _cairo_malloc_ab (num_glyphs, sizeof(cairo_glyph_t));
if (transformed_glyphs == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
diff --git a/src/cairo-hash.c b/src/cairo-hash.c
index 09450f70..70518600 100644
--- a/src/cairo-hash.c
+++ b/src/cairo-hash.c
@@ -150,7 +150,7 @@ _cairo_hash_table_create (cairo_hash_keys_equal_func_t keys_equal)
hash_table = malloc (sizeof (cairo_hash_table_t));
if (hash_table == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return NULL;
}
@@ -162,7 +162,7 @@ _cairo_hash_table_create (cairo_hash_keys_equal_func_t keys_equal)
sizeof(cairo_hash_entry_t *));
if (hash_table->entries == NULL) {
free (hash_table);
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return NULL;
}
@@ -332,7 +332,7 @@ _cairo_hash_table_resize (cairo_hash_table_t *hash_table)
new_size = tmp.arrangement->size;
tmp.entries = calloc (new_size, sizeof (cairo_hash_entry_t*));
if (tmp.entries == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
diff --git a/src/cairo-hull.c b/src/cairo-hull.c
index fb4e71c3..f5d05e47 100644
--- a/src/cairo-hull.c
+++ b/src/cairo-hull.c
@@ -64,7 +64,7 @@ _cairo_hull_create (cairo_pen_vertex_t *vertices, int num_vertices)
hull = _cairo_malloc_ab (num_vertices, sizeof (cairo_hull_t));
if (hull == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return NULL;
}
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 1b801734..091a9572 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -1063,7 +1063,7 @@ _cairo_image_surface_fill_rectangles (void *abstract_surface,
if (num_rects > ARRAY_LENGTH(stack_rects)) {
pixman_rects = _cairo_malloc_ab (num_rects, sizeof(pixman_rectangle16_t));
if (pixman_rects == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
}
@@ -1080,8 +1080,10 @@ _cairo_image_surface_fill_rectangles (void *abstract_surface,
surface->pixman_image,
&pixman_color,
num_rects,
- pixman_rects))
+ pixman_rects)) {
status = CAIRO_STATUS_NO_MEMORY;
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ }
if (pixman_rects != stack_rects)
free (pixman_rects);
@@ -1127,7 +1129,7 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t op,
if (num_traps > ARRAY_LENGTH(stack_traps)) {
pixman_traps = _cairo_malloc_ab (num_traps, sizeof(pixman_trapezoid_t));
if (pixman_traps == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
}
@@ -1205,7 +1207,7 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t op,
mask_data = calloc (mask_stride, height);
if (mask_data == NULL) {
status = CAIRO_STATUS_NO_MEMORY;
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
goto CLEANUP_SOURCE;
}
@@ -1213,7 +1215,7 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t op,
mask_data, mask_stride);
if (mask == NULL) {
status = CAIRO_STATUS_NO_MEMORY;
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
goto CLEANUP_IMAGE_DATA;
}
diff --git a/src/cairo-lzw.c b/src/cairo-lzw.c
index 00aa71b1..73d82a3e 100644
--- a/src/cairo-lzw.c
+++ b/src/cairo-lzw.c
@@ -76,7 +76,7 @@ _lzw_buf_init (lzw_buf_t *buf, int size)
if (buf->data == NULL) {
buf->data_size = 0;
buf->status = CAIRO_STATUS_NO_MEMORY;
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return;
}
}
@@ -103,7 +103,7 @@ _lzw_buf_grow (lzw_buf_t *buf)
free (buf->data);
buf->data_size = 0;
buf->status = CAIRO_STATUS_NO_MEMORY;
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return buf->status;
}
diff --git a/src/cairo-meta-surface.c b/src/cairo-meta-surface.c
index 3fc61a8f..ac43be99 100644
--- a/src/cairo-meta-surface.c
+++ b/src/cairo-meta-surface.c
@@ -253,7 +253,7 @@ _cairo_meta_surface_paint (void *abstract_surface,
command = malloc (sizeof (cairo_command_paint_t));
if (command == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -296,7 +296,7 @@ _cairo_meta_surface_mask (void *abstract_surface,
command = malloc (sizeof (cairo_command_mask_t));
if (command == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -344,7 +344,7 @@ _cairo_meta_surface_stroke (void *abstract_surface,
command = malloc (sizeof (cairo_command_stroke_t));
if (command == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -401,7 +401,7 @@ _cairo_meta_surface_fill (void *abstract_surface,
command = malloc (sizeof (cairo_command_fill_t));
if (command == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}
@@ -450,7 +450,7 @@ _cairo_meta_surface_show_glyphs (void *abstract_surface,
command = malloc (sizeof (cairo_command_show_glyphs_t));
if (command == NULL) {
- _cairo_error (CAIRO_STATUS_SUCCESS);
+ _cairo_error (CAIRO_STATUS_NO_MEMORY);
return CAIRO_STATUS_NO_MEMORY;
}