Yet another crash fix from upstream

epel9
Yanko Kaneti 11 years ago
parent d1da759b16
commit 477bcad3a8

@ -0,0 +1,27 @@
From 3358deaeb0a2025d0bfa8458e697f0e911e2f363 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 13 Nov 2013 18:21:19 +0100
Subject: [PATCH] mobi: Fix parsing garbage with no cover
We were never checking the retval of get_cover_img_num() so if
no covers were found, we'd try to read index-of-first-img minus 1.
---
gnome-mobi-thumbnailer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gnome-mobi-thumbnailer.c b/gnome-mobi-thumbnailer.c
index 67c04bf..797192a 100644
--- a/gnome-mobi-thumbnailer.c
+++ b/gnome-mobi-thumbnailer.c
@@ -183,6 +183,8 @@ get_image_section (GInputStream *stream,
}
image_num = get_cover_img_num (header);
+ if (image_num < 0)
+ return image_num;
return first_img + image_num;
}
--
1.8.5.2

@ -1,6 +1,6 @@
Name: gnome-epub-thumbnailer
Version: 1.3
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Thumbnailers for EPub and MOBI books
License: GPLv2+
@ -13,6 +13,8 @@ Patch1: 0001-epub-Set-an-error-when-the-cover-can-t-be-found.patch
Patch2: 0001-mobi-Don-t-bail-on-encrypted-mobi-files.patch
# Upstream commit 53d83c1a4a7f140149fec7f2aecf91034dbb3546
Patch3: 0001-Update-skeleton-to-fix-crash-with-trash-recent-files.patch
# Upstream commit 3358deaeb0a2025d0bfa8458e697f0e911e2f363
Patch4: 0001-mobi-Fix-parsing-garbage-with-no-cover.patch
BuildRequires: pkgconfig(gdk-pixbuf-2.0)
BuildRequires: pkgconfig(gio-2.0)
@ -48,6 +50,9 @@ make DESTDIR=$RPM_BUILD_ROOT install
%changelog
* Thu Jan 16 2014 Yanko Kaneti <yaneti@declera.com> - 1.3-4
- Yet another crash fix from upstream
* Mon Jan 6 2014 Yanko Kaneti <yaneti@declera.com> - 1.3-3
- Fix crashes on thumbnailing trash/recent files - #1046245
- Get unencrypted cover from otherwise encrypted mobi files

Loading…
Cancel
Save