[cairo-commit] 2 commits - src/cairo-scaled-font.c src/cairo-scaled-font-subsets.c
Chris Wilson
ickle at kemper.freedesktop.org
Sun Jun 29 06:24:45 PDT 2008
src/cairo-scaled-font-subsets.c | 2 +-
src/cairo-scaled-font.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit c394b72ee99882882897776115b007f40a96fe95
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Jun 29 13:16:10 2008 +0100
[cairo-scaled-font] Suppress compiler warning about unused variables.
Use _cairo_error_throw() for the cases where we cannot propagate the
status return.
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index f244984..3e5e252 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -1180,13 +1180,13 @@ cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font,
return;
if (num_glyphs < 0) {
- cairo_status_t status = _cairo_error (CAIRO_STATUS_NEGATIVE_COUNT);
+ _cairo_error_throw (CAIRO_STATUS_NEGATIVE_COUNT);
/* XXX Can't propagate error */
return;
}
if (glyphs == NULL) {
- cairo_status_t status = _cairo_error (CAIRO_STATUS_NULL_POINTER);
+ _cairo_error_throw (CAIRO_STATUS_NULL_POINTER);
/* XXX Can't propagate error */
return;
}
commit 5b7903d5a75b10c924c91654e22a78650796ae63
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Jun 29 13:09:17 2008 +0100
[cairo-scaled-font-subsets] Add missing malloc check.
A minor oversight in d77b04fd0635c1648bb024b5308b715c220e1e74.
diff --git a/src/cairo-scaled-font-subsets.c b/src/cairo-scaled-font-subsets.c
index 7be7181..c0da4da 100644
--- a/src/cairo-scaled-font-subsets.c
+++ b/src/cairo-scaled-font-subsets.c
@@ -810,7 +810,7 @@ _cairo_scaled_font_subsets_foreach_internal (cairo_scaled_font_subsets_t
collection.glyphs = _cairo_malloc_ab (collection.glyphs_size, sizeof(unsigned long));
collection.utf8 = _cairo_malloc_ab (collection.glyphs_size, sizeof(char *));
- if (collection.glyphs == NULL)
+ if (collection.glyphs == NULL || collection.utf8 == NULL)
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
collection.font_subset_callback = font_subset_callback;
More information about the cairo-commit
mailing list