From 4801638536a61e0b81df1f2278703a819918ce11 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 1 Feb 2009 10:12:10 +0000 Subject: [PATCH] Clamp top/bottom values of destinations to make sure they are not bigger 2009-02-01 Carlos Garcia Campos * backend/pdf/ev-poppler.cc: (ev_link_dest_from_dest): Clamp top/bottom values of destinations to make sure they are not bigger than the page height. Fixes bug #569327. svn path=/trunk/; revision=3396 --- ChangeLog | 7 +++++++ backend/pdf/ev-poppler.cc | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f14fa1b9..4215dc37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-01 Carlos Garcia Campos + + * backend/pdf/ev-poppler.cc: (ev_link_dest_from_dest): + + Clamp top/bottom values of destinations to make sure they are not + bigger than the page height. Fixes bug #569327. + 2009-02-01 Carlos Garcia Campos * libdocument/ev-debug.h: diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index bdce0b52..a0c0f897 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -883,7 +883,7 @@ ev_link_dest_from_dest (PdfDocument *pdf_document, poppler_page_get_size (poppler_page, NULL, &height); ev_dest = ev_link_dest_new_xyz (dest->page_num - 1, dest->left, - height - dest->top, + height - MIN (height, dest->top), dest->zoom, dest->change_left, dest->change_top, @@ -902,7 +902,7 @@ ev_link_dest_from_dest (PdfDocument *pdf_document, MAX (0, dest->page_num - 1)); poppler_page_get_size (poppler_page, NULL, &height); ev_dest = ev_link_dest_new_fith (dest->page_num - 1, - height - dest->top, + height - MIN (height, dest->top), dest->change_top); g_object_unref (poppler_page); } @@ -921,9 +921,9 @@ ev_link_dest_from_dest (PdfDocument *pdf_document, poppler_page_get_size (poppler_page, NULL, &height); ev_dest = ev_link_dest_new_fitr (dest->page_num - 1, dest->left, - height - dest->bottom, + height - MIN (height, dest->bottom), dest->right, - height - dest->top); + height - MIN (height, dest->top)); g_object_unref (poppler_page); } break; -- 2.43.5