[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.
This commit is contained in:
Chris Wilson 2007-10-04 23:07:36 +01:00
parent dbbcb5c26f
commit 7601939a65

View file

@ -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);