[gnome-epub-thumbnailer] mobi: Fix parsing garbage with no cover



commit 3358deaeb0a2025d0bfa8458e697f0e911e2f363
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Nov 13 18:21:19 2013 +0100

    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 files changed, 2 insertions(+), 0 deletions(-)
---
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;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]