You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gnome-epub-thumbnailer/0002-mobi-Avoid-malformed-o...

30 lines
881 B

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