Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2007-06-29 08:10:30 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2007-06-29 08:10:30 (GMT)
commit0fc58f120a81a23d1ab13989e0fc19ee42543323 (patch)
treed3c9d239660737af13ed90f8aab81658a7c4f7b3 /backend
parentc77da3648c8a899826c9e53bde70d320c1c615cc (diff)
Make sure thumbnails width and height is not <= 0. Fixes a crash with some
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
Diffstat (limited to 'backend')
-rw-r--r--backend/pdf/ev-poppler.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index e3b80b4..5cdedde 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -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;