From fc93a1e28f852d6b454880f2b3c624b15a0343ca Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 6 Sep 2019 11:52:03 -0500 Subject: [PATCH] Check errors after rsvg_handle_close() In librsvg 2.46, this will be the place in the write()/close() APIs to check for errors, since internally they buffer the entire document in case it is compressed. A subsequent MR will be about using the streaming API instead, which does not require that kind of buffering. --- src/eog-image.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/eog-image.c b/src/eog-image.c index 69169612..9ee130ff 100644 --- a/src/eog-image.c +++ b/src/eog-image.c @@ -1114,10 +1114,13 @@ eog_image_real_load (EogImage *img, if (read_image_data || read_only_dimension) { #ifdef HAVE_RSVG if (use_rsvg) { - /* Ignore the error if loading failed earlier - * as the error will already be set in that case */ - rsvg_handle_close (priv->svg, - (failed ? NULL : error)); + if (failed) { + /* Ignore the error if loading failed earlier + * as the error will already be set in that case */ + rsvg_handle_close (priv->svg, NULL); + } else { + failed = !rsvg_handle_close (priv->svg, error); + } } else #endif if (failed) { -- GitLab