]> www.fi.muni.cz Git - evince.git/commitdiff
Make sure find_result is never < 0 which causes a crash while searching.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 23 Nov 2008 16:56:39 +0000 (16:56 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sun, 23 Nov 2008 16:56:39 +0000 (16:56 +0000)
2008-11-23  Carlos Garcia Campos  <carlosgc@gnome.org>

* shell/ev-view.c: (ev_view_find_previous):

Make sure find_result is never < 0 which causes a crash while
searching. Fixes bug #558377.

svn path=/trunk/; revision=3273

ChangeLog
shell/ev-view.c

index 343dee7b651aa2870429e6ead0941484e827270e..e8b0304e780ba1f7d07ca36f2fcfeac037f2a9b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-11-23  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-view.c: (ev_view_find_previous):
+
+       Make sure find_result is never < 0 which causes a crash while
+       searching. Fixes bug #558377.
+       
 2008-11-19  Marek Kašík <mkasik@redhat.com>
 
        * shell/ev-pixbuf-cache.c (new_selection_surface_needed),
index 9c575d270d5911651dcb9fbd15ecbf29ae964d1d..02a278325ec63ee8c51fc66306246974782a4cf4 100644 (file)
@@ -5181,7 +5181,7 @@ ev_view_find_previous (EvView *view)
 
        if (view->find_result < 0) {
                jump_to_find_page (view, EV_VIEW_FIND_PREV, -1);
-               view->find_result = ev_view_find_get_n_results (view, view->current_page) - 1;
+               view->find_result = MAX (0, ev_view_find_get_n_results (view, view->current_page) - 1);
                jump_to_find_result (view);
        } else {
                jump_to_find_result (view);