From: Carlos Garcia Campos Date: Sun, 23 Nov 2008 16:56:39 +0000 (+0000) Subject: Make sure find_result is never < 0 which causes a crash while searching. X-Git-Tag: EVINCE_2_25_2~9 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=15940d1d8b71c9c3c73ea2bad5800ee09819e541;p=evince.git Make sure find_result is never < 0 which causes a crash while searching. 2008-11-23 Carlos Garcia Campos * 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 --- diff --git a/ChangeLog b/ChangeLog index 343dee7b..e8b0304e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-11-23 Carlos Garcia Campos + + * 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 * shell/ev-pixbuf-cache.c (new_selection_surface_needed), diff --git a/shell/ev-view.c b/shell/ev-view.c index 9c575d27..02a27832 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -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);