summaryrefslogtreecommitdiff
path: root/src/dispnew.c
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1995-05-19 21:53:18 +0000
committerKarl Heuer <kwzh@gnu.org>1995-05-19 21:53:18 +0000
commit0fed01c40400cda0ab2de01f4c28d3c09cdfba33 (patch)
tree5e472c41209e653350ea3786a920ef881cd38912 /src/dispnew.c
parent6d7664058661d6fbc038bd2cfd027da14b2699df (diff)
downloademacs-0fed01c40400cda0ab2de01f4c28d3c09cdfba33.tar.gz
(buffer_posn_from_coords): Don't let startp be before BEGV.
Diffstat (limited to 'src/dispnew.c')
-rw-r--r--src/dispnew.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 206cdb89661..8f010f7795b 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1504,6 +1504,11 @@ buffer_posn_from_coords (window, col, line)
current_buffer = XBUFFER (window->buffer);
+ /* We can't get a correct result in this case,
+ but at least prevent compute_motion from crashing. */
+ if (startp < BEGV)
+ startp = BEGV;
+
/* It would be nice if we could use FRAME_CURRENT_GLYPHS (XFRAME
(window->frame))->bufp to avoid scanning from the very top of
the window, but it isn't maintained correctly, and I'm not even