]> www.fi.muni.cz Git - evince.git/commitdiff
[libview] Fix a crash with document that contain no pages or empty pages
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 20 Dec 2009 16:38:46 +0000 (17:38 +0100)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 20 Dec 2009 16:38:46 +0000 (17:38 +0100)
Fixes bgo#605029.

libview/ev-view.c

index 735ad1349e48d035c55fa74618994343325c7d23..7a3a6dc276f116ce3e466f28617c7b1422ba164f 100644 (file)
@@ -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;