]> 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:10:30 +0000 (08:10 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Fri, 29 Jun 2007 08:10:30 +0000 (08:10 +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=/trunk/; revision=2525

ChangeLog
backend/pdf/ev-poppler.cc

index 135629308490ac3c48e2fd9f9f0fa87606cd3ade..7b0e60554c7176c7d2ed6d0b91ea2c86bfee0ebd 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-22  Gabor Kelemen  <kelemeng@gnome.hu>
 
        * shell/main.c: (main):
index e3b80b450d8d93e02fc5232fe442500613c3c2d0..5cdeddecbf6ad4f960d731420b97b53c3f54603b 100644 (file)
@@ -448,7 +448,7 @@ pdf_document_render (EvDocument      *document,
                width = (int) ((width_points * rc->scale) + 0.5);
                height = (int) ((height_points * rc->scale) + 0.5);
        }
-       
+
 #ifdef HAVE_POPPLER_PAGE_RENDER
        cairo_t *cr;
        
@@ -1283,10 +1283,10 @@ 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) {
                gint  temp;