]> www.fi.muni.cz Git - evince.git/commitdiff
Make sure thumbnails width and height is not <= 0. Fixes a crash with some
authorCarlos Garcia Campos <carlosgc@gnome.org>
Fri, 29 Jun 2007 08:12:43 +0000 (08:12 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Fri, 29 Jun 2007 08:12:43 +0000 (08:12 +0000)
2007-06-29  Carlos Garcia Campos  <carlosgc@gnome.org>
* backend/pdf/ev-poppler.cc:
(pdf_document_thumbnails_get_dimensions):
Make sure thumbnails width and height is not <= 0. Fixes a crash
with some pdf documents which have really small pages.

svn path=/branches/gnome-2-18/; revision=2526

ChangeLog
backend/pdf/ev-poppler.cc

index 0d2c9dada745dd4867905ea395b149fcfcd41826..3db45720ed01f19516ad5cf3c2cbbea6e4f7a159 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-06-29  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * backend/pdf/ev-poppler.cc:
+       (pdf_document_thumbnails_get_dimensions):
+
+       Make sure thumbnails width and height is not <= 0. Fixes a crash
+       with some pdf documents which have really small pages.
+       
 2007-06-21  Cesar Fernandez  <cesar@pk2.org>
 
        * shell/ev-view.c: (ev_view_next_page), (ev_view_previous_page):
index 1edbb4893c5f2011423319ed1801b5c48f492fc5..375489f5903815c660a8b94099230fca90178a42 100644 (file)
@@ -1252,8 +1252,8 @@ pdf_document_thumbnails_get_dimensions (EvDocumentThumbnails *document_thumbnail
 
                poppler_page_get_size (poppler_page, &page_width, &page_height);
 
-               *width = (gint) (page_width * rc->scale);
-               *height = (gint) (page_height * rc->scale);
+               *width = (gint) MAX (page_width * rc->scale, 1);
+               *height = (gint) MAX (page_height * rc->scale, 1);
        }
 
        if (rc->rotation == 90 || rc->rotation == 270) {