diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-09-28 13:07:17 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-09-28 13:07:17 -0700 |
commit | b13f71e2dda86836dc7dea90b385b3791f8ebd01 (patch) | |
tree | d15fcbcfb6b94693c2db439828e7daa4e07fe0fc /src/bidi.c | |
parent | 7b09a37a895ab2d428d1ab0786aa262ef82efba2 (diff) | |
parent | e1504b9b0b2fdcf757c29dcc65ffe8b670cc7604 (diff) | |
download | emacs-b13f71e2dda86836dc7dea90b385b3791f8ebd01.tar.gz emacs-b13f71e2dda86836dc7dea90b385b3791f8ebd01.tar.bz2 emacs-b13f71e2dda86836dc7dea90b385b3791f8ebd01.zip |
Merge from trunk.
Diffstat (limited to 'src/bidi.c')
-rw-r--r-- | src/bidi.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bidi.c b/src/bidi.c index c7b3a770597..a43490f4110 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -974,6 +974,15 @@ bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos, ch = 0xFFFC; } disp_end_pos = compute_display_string_end (*disp_pos, string); + if (disp_end_pos < 0) + { + /* Somebody removed the display string from the buffer + behind our back. Recover by processing this buffer + position as if no display property were present there to + begin with. */ + *disp_prop = 0; + goto normal_char; + } *nchars = disp_end_pos - *disp_pos; if (*nchars <= 0) abort (); @@ -988,6 +997,7 @@ bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos, } else { + normal_char: if (string->s) { int len; |