diff options
| author | Eli Zaretskii | 2013-08-10 00:19:42 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-08-10 00:19:42 +0300 |
| commit | 14ba08227d9272a34a0a95d20640f4bbdd0b6033 (patch) | |
| tree | 51c37ef310c94bbbe01499cf9d22348ed59973ea | |
| parent | 0ea9e53aa950f9cd88d0350deec813036fa33f6c (diff) | |
| download | emacs-14ba08227d9272a34a0a95d20640f4bbdd0b6033.tar.gz emacs-14ba08227d9272a34a0a95d20640f4bbdd0b6033.zip | |
Fix bug #15064 with assertion violation due to mouse face.
src/xdisp.c (draw_glyphs): Don't compare row pointers, compare row
vertical positions instead. This avoids calling MATRIX_ROW with
row numbers that are possibly beyond valid limits.
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bd8aae80d5d..642b6b32231 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-08-09 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (draw_glyphs): Don't compare row pointers, compare row | ||
| 4 | vertical positions instead. This avoids calling MATRIX_ROW with | ||
| 5 | row numbers that are possibly beyond valid limits. (Bug#15064) | ||
| 6 | |||
| 1 | 2013-08-09 Dmitry Antipov <dmantipov@yandex.ru> | 7 | 2013-08-09 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 8 | ||
| 3 | Use xstrdup and build_unibyte_string where applicable. | 9 | Use xstrdup and build_unibyte_string where applicable. |
diff --git a/src/xdisp.c b/src/xdisp.c index aee24e27d52..35abf71e5bf 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -23826,17 +23826,15 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row, | |||
| 23826 | && hlinfo->mouse_face_beg_row >= 0 | 23826 | && hlinfo->mouse_face_beg_row >= 0 |
| 23827 | && hlinfo->mouse_face_end_row >= 0) | 23827 | && hlinfo->mouse_face_end_row >= 0) |
| 23828 | { | 23828 | { |
| 23829 | struct glyph_row *mouse_beg_row, *mouse_end_row; | 23829 | ptrdiff_t row_vpos = MATRIX_ROW_VPOS (row, w->current_matrix); |
| 23830 | 23830 | ||
| 23831 | mouse_beg_row = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_beg_row); | 23831 | if (row_vpos >= hlinfo->mouse_face_beg_row |
| 23832 | mouse_end_row = MATRIX_ROW (w->current_matrix, hlinfo->mouse_face_end_row); | 23832 | && row_vpos <= hlinfo->mouse_face_end_row) |
| 23833 | |||
| 23834 | if (row >= mouse_beg_row && row <= mouse_end_row) | ||
| 23835 | { | 23833 | { |
| 23836 | check_mouse_face = 1; | 23834 | check_mouse_face = 1; |
| 23837 | mouse_beg_col = (row == mouse_beg_row) | 23835 | mouse_beg_col = (row_vpos == hlinfo->mouse_face_beg_row) |
| 23838 | ? hlinfo->mouse_face_beg_col : 0; | 23836 | ? hlinfo->mouse_face_beg_col : 0; |
| 23839 | mouse_end_col = (row == mouse_end_row) | 23837 | mouse_end_col = (row_vpos == hlinfo->mouse_face_end_row) |
| 23840 | ? hlinfo->mouse_face_end_col | 23838 | ? hlinfo->mouse_face_end_col |
| 23841 | : row->used[TEXT_AREA]; | 23839 | : row->used[TEXT_AREA]; |
| 23842 | } | 23840 | } |