[evince] [libview] Fix a crash with document that contain no pages or empty pages



commit bf8fe0d26b7319b9ad3a8a79fbf618343f603c62
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sun Dec 20 17:38:46 2009 +0100

    [libview] Fix a crash with document that contain no pages or empty pages
    
    Fixes bgo#605029.

 libview/ev-view.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 735ad13..7a3a6dc 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -637,7 +637,11 @@ view_update_range_and_current_page (EvView *view)
 {
 	gint start = view->start_page;
 	gint end = view->end_page;
-	
+
+	if (ev_document_get_n_pages (view->document) <= 0 ||
+	    !ev_document_check_dimensions (view->document))
+		return;
+
 	/* Presentation trumps all other modes */
 	if (view->presentation) {
 		view->start_page = view->current_page;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]