Fix regression from a1fe0f0b

In some cases sc_reload could still segfault. This should fix it.
This commit is contained in:
Sebastian Ramacher 2011-03-21 02:09:38 +01:00
parent 315f61b157
commit a48ee6be46

View File

@ -2205,10 +2205,12 @@ sc_reload(Argument* argument)
gtk_adjustment_set_value(hadjustment, ha); gtk_adjustment_set_value(hadjustment, ha);
g_static_mutex_unlock(&(Zathura.Lock.pdf_obj_lock)); g_static_mutex_unlock(&(Zathura.Lock.pdf_obj_lock));
if (page >= Zathura.PDF.number_of_pages - 1) if (Zathura.PDF.number_of_pages != 0) {
page = Zathura.PDF.number_of_pages - 1; if (page >= Zathura.PDF.number_of_pages - 1)
Zathura.PDF.page_number = page; page = Zathura.PDF.number_of_pages - 1;
draw(Zathura.PDF.page_number); Zathura.PDF.page_number = page;
draw(Zathura.PDF.page_number);
}
if(path) if(path)
free(path); free(path);