diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-02-11 14:58:21 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-02-15 13:50:42 +0000 |
commit | ad265cc9f26a20f2336747d69b28bc6ca0d91f4b (patch) | |
tree | 879b767e5d236214405704c56760acea25c5fa5d /src/cairo-font-face.c | |
parent | 790eaef71cbd30e1994c9499ab553f2ef5e5d620 (diff) |
[cairo-font-options] Disallow use of NULL font-options.
Partial revert of commit 0086db893cba90dc73824d77c661d2965ad48112.
This is a follow to the earlier commit that allowed creation of scaled
fonts using a NULL font options (by interpreting the NULL as meaning
use the default options) to reflect the comments made by Behdad
(http://lists.cairographics.org/archives/cairo/2008-January/012714.html).
The intent is that the public font options getter/setter API has similar
defensive behaviour to that of the core objects - i.e. do not overwrite
the nil object and if the object is in error then return the default
value. For the indirect use of a NULL/nil font options (e.g. creation of
scaled fonts), then an error should be returned rather than crashing.
Diffstat (limited to 'src/cairo-font-face.c')
-rw-r--r-- | src/cairo-font-face.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c index 397dd563..20771209 100644 --- a/src/cairo-font-face.c +++ b/src/cairo-font-face.c @@ -476,11 +476,9 @@ _cairo_toy_font_face_scaled_font_create (void *abstract_font_face if (font_face->base.status) return font_face->base.status; - if (options != NULL) { - status = cairo_font_options_status ((cairo_font_options_t *) options); - if (status) - return status; - } + status = cairo_font_options_status ((cairo_font_options_t *) options); + if (status) + return status; return _cairo_font_face_set_error (&font_face->base, backend->create_toy (font_face, |