[cairo-commit] src/cairo-ps-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Aug 27 10:15:20 PDT 2008


 src/cairo-ps-surface.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit a8c0998baf17357ce962dec795c9d6134e76e94a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Aug 27 14:58:53 2008 +0100

    [ps] Check tmpfile status after reading.
    
    Be paranoid and check to see if we encountered an error whilst reading the
    temporary file.

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 981f69d..8fcf89e 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -619,6 +619,9 @@ _cairo_ps_surface_emit_body (cairo_ps_surface_t *surface)
     while ((n = fread (buf, 1, sizeof (buf), surface->tmpfile)) > 0)
 	_cairo_output_stream_write (surface->final_stream, buf, n);
 
+    if (ferror (surface->tmpfile) != 0)
+	return _cairo_error (CAIRO_STATUS_TEMP_FILE_ERROR);
+
     return CAIRO_STATUS_SUCCESS;
 }
 


More information about the cairo-commit mailing list