mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-14 15:06:01 +01:00
Check indices before accessing the list
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
797b83bfed
commit
2d785cc20d
1 changed files with 3 additions and 3 deletions
|
@ -310,9 +310,9 @@ zathura_page_widget_set_property(GObject* object, guint prop_id, const GValue* v
|
|||
priv->search.current = girara_list_size(priv->search.list);
|
||||
} else {
|
||||
priv->search.current = val;
|
||||
zathura_rectangle_t* rect = girara_list_nth(priv->search.list, priv->search.current);
|
||||
zathura_rectangle_t rectangle = recalc_rectangle(priv->page, *rect);
|
||||
if (priv->search.draw) {
|
||||
if (priv->search.draw == true && val >= 0 && val < (signed) girara_list_size(priv->search.list)) {
|
||||
zathura_rectangle_t* rect = girara_list_nth(priv->search.list, priv->search.current);
|
||||
zathura_rectangle_t rectangle = recalc_rectangle(priv->page, *rect);
|
||||
redraw_rect(pageview, &rectangle);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue