From 1cbd02c141a117071900a58d4c30960237d3f37f Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Tue, 14 Aug 2007 20:43:22 +0200 Subject: [PATCH] Avoid segfault. Go to the page with a few lines. Follow a link to a page with more lines. Move cursor down, do not stay on a link. Go back and do move-link-prev-line. This caused a segmentation fault. (cherry picked from commit 888ba8751674471768d846ff3443aa7bb71ecf82) --- src/viewer/text/view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index d9344b128..c208efed3 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -189,8 +189,8 @@ move_link_prev_line(struct session *ses, struct document_view *doc_view) get_link_x_bounds(link, y1, &min_x, &max_x); } else { min_x = max_x = x1; - int_upper_bound(&y, document->height - 1); } + int_upper_bound(&y, document->height - 1); for (; y >= 0; y--, min_x = INT_MAX) { link = document->lines1[y]; @@ -238,8 +238,8 @@ move_link_next_line(struct session *ses, struct document_view *doc_view) get_link_x_bounds(link, y1, &min_x, &max_x); } else { min_x = max_x = x1; - int_upper_bound(&y, document->height - 1); } + int_upper_bound(&y, document->height - 1); for (; y < document->height; y++, min_x = -1) { link = document->lines1[y];