[eog: 1/2] Check errors after rsvg_handle_close()



commit fc93a1e28f852d6b454880f2b3c624b15a0343ca
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Sep 6 11:52:03 2019 -0500

    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) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]