From edce97a750acf4368bd7249ec6b9a195f8584cdf Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 30 Mar 2009 16:50:51 +0100 Subject: [PATCH] [pdf] Remove false assertion. The stream itself may be in an error state, so an error could be raised. --- src/cairo-pdf-surface.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index f562e3fd8..2faa9420d 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -1324,10 +1324,12 @@ _cairo_pdf_surface_finish (void *abstract_surface) "%%%%EOF\n", offset); - status2 = _cairo_pdf_operators_fini (&surface->pdf_operators); /* pdf_operators has already been flushed when the last stream was - * closed so we should never be writing anything here. */ - assert(status2 == CAIRO_STATUS_SUCCESS); + * closed so we should never be writing anything here - however, + * the stream may itself be in an error state. */ + status2 = _cairo_pdf_operators_fini (&surface->pdf_operators); + if (status == CAIRO_STATUS_SUCCESS) + status = status2; /* close any active streams still open due to fatal errors */ status2 = _cairo_pdf_surface_close_stream (surface);