[libgxps] gxps-archive: Handle errors returned by archive_read_data
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgxps] gxps-archive: Handle errors returned by archive_read_data
- Date: Sat, 5 May 2018 10:04:46 +0000 (UTC)
commit 133fe2a96e020d4ca65c6f64fb28a404050ebbfd
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sat May 5 12:02:36 2018 +0200
gxps-archive: Handle errors returned by archive_read_data
libgxps/gxps-archive.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libgxps/gxps-archive.c b/libgxps/gxps-archive.c
index 346ba73..1bae729 100644
--- a/libgxps/gxps-archive.c
+++ b/libgxps/gxps-archive.c
@@ -520,6 +520,13 @@ gxps_archive_input_stream_read (GInputStream *stream,
return -1;
bytes_read = archive_read_data (istream->zip->archive, buffer, count);
+ if (bytes_read < 0) {
+ g_set_error_literal (error,
+ G_IO_ERROR,
+ g_io_error_from_errno (archive_errno (istream->zip->archive)),
+ archive_error_string (istream->zip->archive));
+ return -1;
+ }
if (bytes_read == 0 && istream->is_interleaved && !gxps_archive_input_stream_is_last_piece
(istream)) {
/* Read next piece */
gxps_archive_input_stream_next_piece (istream);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]