diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-04 23:07:36 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-04 23:07:36 +0100 |
commit | 7601939a6524ad97a333fef910f3b5e69c46776c (patch) | |
tree | 6e96f309c21776beaa357a4c90611cac75bb8edb | |
parent | dbbcb5c26fba77d2a828b253c97e4770b81cf90b (diff) |
[cairo-deflate-stream] Return the nil stream if creating from an error stream.
If _cairo_deflate_stream_create() is passed a stream in the error state,
return a stream also in the error state, namely the _cairo_output_stream_nil.
-rw-r--r-- | src/cairo-deflate-stream.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cairo-deflate-stream.c b/src/cairo-deflate-stream.c index 73746fe1..707832db 100644 --- a/src/cairo-deflate-stream.c +++ b/src/cairo-deflate-stream.c @@ -117,6 +117,12 @@ _cairo_deflate_stream_create (cairo_output_stream_t *output) { cairo_deflate_stream_t *stream; + if (output->status) { + _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); + return (cairo_output_stream_t *) &_cairo_output_stream_nil; + } + + stream = malloc (sizeof (cairo_deflate_stream_t)); if (stream == NULL) { _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); |