Pick couple uptream fixes. Should help avoid RHBZ 1103325

epel9
Yanko Kaneti 11 years ago
parent 44e0e908cf
commit 41445c59b3

@ -0,0 +1,32 @@
From 6b8964ee5716ce6abe86d656886f3b389fa4c0cb Mon Sep 17 00:00:00 2001
From: Chris Lee <clee@mg8.org>
Date: Fri, 4 Apr 2014 05:26:20 -0700
Subject: [PATCH 1/2] epub: Fix cover path for root=level OPF files
If the OPF file is in the root dir, g_path_get_dirname returns "."
instead of an empty string. This results in an invalid key for the cover
image, because it looks like "./OEBPS/cover_path.jpg" instead of
"OEBPS/cover_path.jpg" and then unzipping for that path fails.
---
gnome-epub-thumbnailer.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gnome-epub-thumbnailer.c b/gnome-epub-thumbnailer.c
index b3e45e3..07aacc3 100644
--- a/gnome-epub-thumbnailer.c
+++ b/gnome-epub-thumbnailer.c
@@ -196,7 +196,10 @@ resolve_cover_path (const char *cover_path,
char *ret;
dirname = g_path_get_dirname (root_path);
- ret = g_build_filename (dirname, cover_path, NULL);
+ if (g_strcmp0(".", dirname) != 0)
+ ret = g_build_filename (dirname, cover_path, NULL);
+ else
+ ret = g_strdup(cover_path);
g_free (dirname);
return ret;
--
2.0.4

@ -0,0 +1,29 @@
From 585d4b3cee54fe14eabb767dde72e4226a178ea4 Mon Sep 17 00:00:00 2001
From: Yanko Kaneti <yaneti@declera.com>
Date: Sat, 31 May 2014 18:21:30 +0300
Subject: [PATCH 2/2] mobi: Avoid malformed or missing EXTH header
https://bugzilla.redhat.com/show_bug.cgi?id=1103325
---
gnome-mobi-thumbnailer.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gnome-mobi-thumbnailer.c b/gnome-mobi-thumbnailer.c
index 797192a..41c5d94 100644
--- a/gnome-mobi-thumbnailer.c
+++ b/gnome-mobi-thumbnailer.c
@@ -126,6 +126,11 @@ get_cover_img_num (const char *header)
len = get_guint32 (header + 20);
extheader = header + 16 + len;
+ if (!g_str_equal (extheader, "EXTH")) {
+ g_warning ("Corrupt or missing EXTH header");
+ return -1;
+ }
+
num_items = get_guint32 (extheader + 8);
g_debug ("num extheader items: %d", num_items);
extheader = extheader + 12;
--
2.0.4

@ -1,12 +1,17 @@
Name: gnome-epub-thumbnailer
Version: 1.4
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Thumbnailers for EPub and MOBI books
License: GPLv2+
URL: https://git.gnome.org/browse/gnome-epub-thumbnailer
Source0: http://download.gnome.org/sources/%{name}/1.4/%{name}-%{version}.tar.xz
# upstream 6b8964ee5716ce6abe86d656886f3b389fa4c0cb
Patch1: 0001-epub-Fix-cover-path-for-root-level-OPF-files.patch
# upstream 585d4b3cee54fe14eabb767dde72e4226a178ea4
Patch2: 0002-mobi-Avoid-malformed-or-missing-EXTH-header.patch
BuildRequires: pkgconfig(gdk-pixbuf-2.0)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(libxml-2.0)
@ -18,6 +23,7 @@ Thumbnailers for EPub and MOBI books
%prep
%setup -q
%autopatch
%build
@ -40,6 +46,9 @@ make DESTDIR=$RPM_BUILD_ROOT install
%changelog
* Tue Aug 5 2014 Yanko Kaneti <yaneti@declera.com> - 1.4-3
- Pick couple uptream fixes. Should help avoid RHBZ 1103325
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

Loading…
Cancel
Save