mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-04 14:30:21 +01:00
[cairo-output-stream] Propagate error status when copying streams.
During _cairo_memory_stream_copy(), if set, copy the incoming error over to the destination stream and return early.
This commit is contained in:
parent
2c256f292f
commit
de1f92ae14
1 changed files with 10 additions and 2 deletions
|
|
@ -46,7 +46,7 @@
|
|||
#endif /* _MSC_VER */
|
||||
|
||||
|
||||
cairo_private void
|
||||
void
|
||||
_cairo_output_stream_init (cairo_output_stream_t *stream,
|
||||
cairo_output_stream_write_func_t write_func,
|
||||
cairo_output_stream_close_func_t close_func)
|
||||
|
|
@ -58,7 +58,7 @@ _cairo_output_stream_init (cairo_output_stream_t *stream,
|
|||
stream->closed = FALSE;
|
||||
}
|
||||
|
||||
cairo_private cairo_status_t
|
||||
cairo_status_t
|
||||
_cairo_output_stream_fini (cairo_output_stream_t *stream)
|
||||
{
|
||||
return _cairo_output_stream_close (stream);
|
||||
|
|
@ -560,6 +560,14 @@ _cairo_memory_stream_copy (cairo_output_stream_t *base,
|
|||
{
|
||||
memory_stream_t *stream = (memory_stream_t *) base;
|
||||
|
||||
if (dest->status)
|
||||
return;
|
||||
|
||||
if (base->status) {
|
||||
dest->status = base->status;
|
||||
return;
|
||||
}
|
||||
|
||||
_cairo_output_stream_write (dest,
|
||||
_cairo_array_index (&stream->array, 0),
|
||||
_cairo_array_num_elements (&stream->array));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue