summaryrefslogtreecommitdiff
path: root/src/cairo-type1-fallback.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-01-16 16:29:19 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-01-16 16:40:01 +0000
commit5cbc45488e276cb6e6ecfa7bc7dd4fae342de85e (patch)
tree672c700de47687c25c68cb22743c0a058e4b06d1 /src/cairo-type1-fallback.c
parent2c10c7559db11ccf511e119f4d4fb2da97508786 (diff)
[cairo-output-stream] Introduce _cairo_output_stream_create_in_error()
Use a utility function to wrap an incoming error status into a new error stream. As a side-effect, all error streams must be destroyed as in the general case the caller can not distinguish between a static error object and one allocated to hold an unusual error status.
Diffstat (limited to 'src/cairo-type1-fallback.c')
-rw-r--r--src/cairo-type1-fallback.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c
index 3532692ce..0ca499869 100644
--- a/src/cairo-type1-fallback.c
+++ b/src/cairo-type1-fallback.c
@@ -601,10 +601,8 @@ cairo_type1_font_write_private_dict (cairo_type1_font_t *font,
cairo_type1_write_stream_encrypted,
NULL,
font);
- if (encrypted_output == NULL) {
- status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
- goto fail;
- }
+ if (_cairo_output_stream_get_status (encrypted_output))
+ return _cairo_output_stream_destroy (encrypted_output);
/* Note: the first four spaces at the start of this private dict
* are the four "random" bytes of plaintext required by the
@@ -697,6 +695,8 @@ cairo_type1_font_generate (cairo_type1_font_t *font, const char *name)
return status;
font->output = _cairo_output_stream_create (cairo_type1_write_stream, NULL, font);
+ if (_cairo_output_stream_get_status (font->output))
+ return _cairo_output_stream_destroy (font->output);
status = cairo_type1_font_write (font, name);
if (status)