From 3358deaeb0a2025d0bfa8458e697f0e911e2f363 Mon Sep 17 00:00:00 2001 From: Bastien Nocera 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