+ evince-3.24.0-2

Use libarchive to handle compressed comics documents
Resolves: #1468488
This commit is contained in:
Bastien Nocera 2017-07-07 11:30:31 +02:00
parent b466d7087b
commit 8b57424bcf
3 changed files with 11451 additions and 1 deletions

View File

@ -0,0 +1,45 @@
From 499cd2025bc21ca725915f0e0b618bf8df2a0596 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 12 Jul 2017 12:53:19 +0200
Subject: [PATCH] comics: Fix decoding some files in RAR archives
The unarr RAR decoder doesn't like it when we request more data than is
available:
! rar.c:169: Requesting too much data (3563 < 10240)
Clamp the size of the read request to the data left to read.
https://bugzilla.gnome.org/show_bug.cgi?id=784842
---
backend/comics/comics-document.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c
index ee060091..a913641d 100644
--- a/backend/comics/comics-document.c
+++ b/backend/comics/comics-document.c
@@ -318,14 +318,19 @@ comics_document_get_page_size (EvDocument *document,
if (g_strcmp0 (name, page_path) == 0) {
char buf[BLOCK_SIZE];
gssize read;
+ gint64 left;
- read = ev_archive_read_data (comics_document->archive, buf, sizeof(buf), &error);
+ left = ev_archive_get_entry_size (comics_document->archive);
+ read = ev_archive_read_data (comics_document->archive, buf,
+ MIN(BLOCK_SIZE, left), &error);
while (read > 0 && !info.got_info) {
if (!gdk_pixbuf_loader_write (loader, (guchar *) buf, read, &error)) {
read = -1;
break;
}
- read = ev_archive_read_data (comics_document->archive, buf, BLOCK_SIZE, &error);
+ left -= read;
+ read = ev_archive_read_data (comics_document->archive, buf,
+ MIN(BLOCK_SIZE, left), &error);
}
if (read < 0) {
g_warning ("Fatal error reading '%s' in archive: %s", name, error->message);
--
2.13.0

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
Name: evince
Version: 3.24.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Document viewer
License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse
@ -19,6 +19,9 @@ Patch2: 0001-Resolves-rhbz-1404656-crash-on-opening-second-evince.patch
Patch3: 0001-Resolves-deb-762530-rhbz-1061177-add-man-pages.patch
Patch4: 0001-Resolves-rhbz-1358249-page-up-down.patch
Patch5: 0001-Revert-Bump-poppler-requirements-to-0.33.0.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1468488
Patch6: evince-libarchive-gnome-3-24.patch
Patch7: 0001-comics-Fix-decoding-some-files-in-RAR-archives.patch
BuildRequires: pkgconfig(adwaita-icon-theme)
BuildRequires: pkgconfig(gio-unix-2.0) >= %{glib2_version}
@ -29,6 +32,7 @@ BuildRequires: pkgconfig(libsecret-1)
BuildRequires: pkgconfig(libspectre)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(poppler-glib) >= %{poppler_version}
BuildRequires: pkgconfig(libarchive)
BuildRequires: libtiff-devel
BuildRequires: gettext
BuildRequires: libtool
@ -265,6 +269,11 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null ||:
%{_libdir}/mozilla/plugins/libevbrowserplugin.so
%changelog
* Fri Jul 07 2017 Bastien Nocera <bnocera@redhat.com> - 3.24.0-2
+ evince-3.24.0-2
- Use libarchive to handle compressed comics documents
Resolves: #1468488
* Tue Mar 21 2017 Kalev Lember <klember@redhat.com> - 3.24.0-1
- Update to 3.24.0