summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-interchange.c
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2021-07-23 17:22:16 +0200
committerUli Schlachter <psychon@znc.in>2021-07-23 17:22:16 +0200
commit2fbd53a6b33a90a08ef6eda9e5f88e8fb3b97c1e (patch)
treeb99bcdf4741e6473d77ddc0e2ea1e71e76381086 /src/cairo-pdf-interchange.c
parentb408352d450bb8c1b1cc17b14e0d605dc40daaed (diff)
downloadcairo-2fbd53a6b33a90a08ef6eda9e5f88e8fb3b97c1e.tar.gz
pdf: Properly pass on stdio write errors
cairo-pdf was silently ignoring write errors in _cairo_pdf_surface_finish(). Any write errors that happened here ended up setting a "status" variable, but the value in this variable was then unused. This commit fixes this bug by passing this error on to the caller. Additionally, this also adds a test case for this behaviour based on writing to /dev/full. This file is non-standard and thus the test first checks that this file exists and is writable before trying to write to it. This bug was found based on a report from Knut Petersen [0]. [0]: https://lists.cairographics.org/archives/cairo/2021-July/029281.html Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src/cairo-pdf-interchange.c')
-rw-r--r--src/cairo-pdf-interchange.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cairo-pdf-interchange.c b/src/cairo-pdf-interchange.c
index 5cc10eb0b..ad4072e63 100644
--- a/src/cairo-pdf-interchange.c
+++ b/src/cairo-pdf-interchange.c
@@ -1515,7 +1515,7 @@ _cairo_pdf_interchange_free_outlines (cairo_pdf_surface_t *surface)
_cairo_array_fini (&ic->outline);
}
-cairo_int_status_t
+void
_cairo_pdf_interchange_fini (cairo_pdf_surface_t *surface)
{
cairo_pdf_interchange_t *ic = &surface->interchange;
@@ -1539,8 +1539,6 @@ _cairo_pdf_interchange_fini (cairo_pdf_surface_t *surface)
free (ic->docinfo.creator);
free (ic->docinfo.create_date);
free (ic->docinfo.mod_date);
-
- return CAIRO_STATUS_SUCCESS;
}
cairo_int_status_t