From: Richard M. Stallman Date: Mon, 8 Aug 1994 10:14:32 +0000 (+0000) Subject: (Fpos_visible_in_window_p): Do something reasonable X-Git-Tag: emacs-19.34~7367 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=61b5322b80d54879e2abddbc8116b970a48418c1;p=emacs.git (Fpos_visible_in_window_p): Do something reasonable if w->start is outside the buffer bounds. --- diff --git a/src/window.c b/src/window.c index bec4aaa30cf..e89fa874c84 100644 --- a/src/window.c +++ b/src/window.c @@ -228,6 +228,10 @@ POS defaults to point; WINDOW, to the selected window.") if (posint > BUF_ZV (buf)) return Qnil; + /* w->start can be out of range. If it is, do something reasonable. */ + if (top < BUF_BEGV (buf) || top > BUF_ZV (buf)) + return Qnil; + /* If that info is not correct, calculate afresh */ posval = *compute_motion (top, 0, (hscroll ? 1 - hscroll : 0), posint, height, 0,