Blame SOURCES/libgxps-0.3.0-archive-handle-error.patch

75766d
From 133fe2a96e020d4ca65c6f64fb28a404050ebbfd Mon Sep 17 00:00:00 2001
75766d
From: Carlos Garcia Campos <carlosgc@gnome.org>
75766d
Date: Sat, 5 May 2018 12:02:36 +0200
75766d
Subject: gxps-archive: Handle errors returned by archive_read_data
75766d
75766d
75766d
diff --git a/libgxps/gxps-archive.c b/libgxps/gxps-archive.c
75766d
index 346ba73..1bae729 100644
75766d
--- a/libgxps/gxps-archive.c
75766d
+++ b/libgxps/gxps-archive.c
75766d
@@ -520,6 +520,13 @@ gxps_archive_input_stream_read (GInputStream  *stream,
75766d
 		return -1;
75766d
 
75766d
         bytes_read = archive_read_data (istream->zip->archive, buffer, count);
75766d
+        if (bytes_read < 0) {
75766d
+                g_set_error_literal (error,
75766d
+                                     G_IO_ERROR,
75766d
+                                     g_io_error_from_errno (archive_errno (istream->zip->archive)),
75766d
+                                     archive_error_string (istream->zip->archive));
75766d
+                return -1;
75766d
+        }
75766d
         if (bytes_read == 0 && istream->is_interleaved && !gxps_archive_input_stream_is_last_piece (istream)) {
75766d
                 /* Read next piece */
75766d
                 gxps_archive_input_stream_next_piece (istream);