From: Carlos Garcia Campos Date: Fri, 29 Jun 2007 08:12:43 +0000 (+0000) Subject: Make sure thumbnails width and height is not <= 0. Fixes a crash with some X-Git-Tag: EVINCE_0_8_2~6 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=fc5bd6e5426b6666958e7fae559c971f2c608d76;p=evince.git Make sure thumbnails width and height is not <= 0. Fixes a crash with some 2007-06-29 Carlos Garcia Campos * 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 --- diff --git a/ChangeLog b/ChangeLog index 0d2c9dad..3db45720 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-06-29 Carlos Garcia Campos + + * 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 * shell/ev-view.c: (ev_view_next_page), (ev_view_previous_page): diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 1edbb489..375489f5 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -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) {