[poppler] glib/poppler-action.cc
Carlos Garcia Campos
carlosgc at kemper.freedesktop.org
Tue Jun 9 02:05:29 PDT 2009
glib/poppler-action.cc | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
New commits:
commit 2cecdf922f4c8178b0e55d3ddf86c31f8be3313a
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date: Tue Jun 9 11:04:39 2009 +0200
[glib] Fix a crash when a destination points to an invalid page
diff --git a/glib/poppler-action.cc b/glib/poppler-action.cc
index 24e1651..f171245 100644
--- a/glib/poppler-action.cc
+++ b/glib/poppler-action.cc
@@ -228,15 +228,20 @@ dest_new_goto (PopplerDocument *document,
if (document && dest->page_num > 0) {
PopplerPage *page;
-
+
page = poppler_document_get_page (document, dest->page_num - 1);
-
- dest->left -= page->page->getCropBox ()->x1;
- dest->bottom -= page->page->getCropBox ()->x1;
- dest->right -= page->page->getCropBox ()->y1;
- dest->top -= page->page->getCropBox ()->y1;
-
- g_object_unref (page);
+
+ if (page) {
+ dest->left -= page->page->getCropBox ()->x1;
+ dest->bottom -= page->page->getCropBox ()->x1;
+ dest->right -= page->page->getCropBox ()->y1;
+ dest->top -= page->page->getCropBox ()->y1;
+
+ g_object_unref (page);
+ } else {
+ g_warning ("Invalid page %d in Link Destination\n", dest->page_num);
+ dest->page_num = 0;
+ }
}
return dest;
More information about the poppler
mailing list