diff options
| author | Adrian Robert | 2009-07-23 13:21:44 +0000 |
|---|---|---|
| committer | Adrian Robert | 2009-07-23 13:21:44 +0000 |
| commit | 7f6ad209681d518fdddddb8dc7ca34316cfae4db (patch) | |
| tree | 30b5d05523828e5eb9e53d86af5708a8b7ed76f7 /src | |
| parent | 5dd9a6f79996ac57275b150b336a492ec8f67e58 (diff) | |
| download | emacs-7f6ad209681d518fdddddb8dc7ca34316cfae4db.tar.gz emacs-7f6ad209681d518fdddddb8dc7ca34316cfae4db.zip | |
* nsterm.m (ns_lookup_indexed_color): Check for bad index. (ns_index_color): Init unused slot to 0. (ns_dumpglyphs_box_or_relief): Replace useless xassert with an if(). Bug 3714, possibly 3082.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/nsterm.m | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3d4ef29a877..fa664e4bc00 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,6 +1,11 @@ | |||
| 1 | 2009-07-23 Adrian Robert <Adrian.B.Robert@gmail.com> | 1 | 2009-07-23 Adrian Robert <Adrian.B.Robert@gmail.com> |
| 2 | 2 | ||
| 3 | * nsterm.m (EmacsView-keyUp:): Only act when running under Tiger. | 3 | * nsterm.m (EmacsView-keyUp:): Only act when running under Tiger. |
| 4 | Bugs 3792, 3720, 2402. | ||
| 5 | (ns_lookup_indexed_color): Check for bad index. | ||
| 6 | (ns_index_color): Init unused slot to 0. | ||
| 7 | (ns_dumpglyphs_box_or_relief): Replace useless xassert with an if(). | ||
| 8 | Bug 3714, possibly 3082. | ||
| 4 | 9 | ||
| 5 | 2009-07-22 Jason Rumney <jasonr@gnu.org> | 10 | 2009-07-22 Jason Rumney <jasonr@gnu.org> |
| 6 | 11 | ||
diff --git a/src/nsterm.m b/src/nsterm.m index e140b0eaefb..6249f217281 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -1249,6 +1249,8 @@ NSColor * | |||
| 1249 | ns_lookup_indexed_color (unsigned long idx, struct frame *f) | 1249 | ns_lookup_indexed_color (unsigned long idx, struct frame *f) |
| 1250 | { | 1250 | { |
| 1251 | struct ns_color_table *color_table = FRAME_NS_DISPLAY_INFO (f)->color_table; | 1251 | struct ns_color_table *color_table = FRAME_NS_DISPLAY_INFO (f)->color_table; |
| 1252 | if (idx < 1 || idx >= color_table->avail) | ||
| 1253 | return nil; | ||
| 1252 | return color_table->colors[idx]; | 1254 | return color_table->colors[idx]; |
| 1253 | } | 1255 | } |
| 1254 | 1256 | ||
| @@ -1266,6 +1268,7 @@ ns_index_color (NSColor *color, struct frame *f) | |||
| 1266 | color_table->avail = 1; /* skip idx=0 as marker */ | 1268 | color_table->avail = 1; /* skip idx=0 as marker */ |
| 1267 | color_table->colors | 1269 | color_table->colors |
| 1268 | = (NSColor **)xmalloc (color_table->size * sizeof (NSColor *)); | 1270 | = (NSColor **)xmalloc (color_table->size * sizeof (NSColor *)); |
| 1271 | color_table->colors[0] = nil; | ||
| 1269 | color_table->empty_indices = [[NSMutableSet alloc] init]; | 1272 | color_table->empty_indices = [[NSMutableSet alloc] init]; |
| 1270 | } | 1273 | } |
| 1271 | 1274 | ||
| @@ -2650,9 +2653,8 @@ ns_dumpglyphs_box_or_relief (struct glyph_string *s) | |||
| 2650 | r = ns_fix_rect_ibw (r, FRAME_INTERNAL_BORDER_WIDTH (s->f), | 2653 | r = ns_fix_rect_ibw (r, FRAME_INTERNAL_BORDER_WIDTH (s->f), |
| 2651 | FRAME_PIXEL_WIDTH (s->f)); | 2654 | FRAME_PIXEL_WIDTH (s->f)); |
| 2652 | 2655 | ||
| 2653 | if (s->face->box == FACE_SIMPLE_BOX) | 2656 | /* TODO: Sometimes box_color is 0 and this seems wrong; should investigate. */ if (s->face->box == FACE_SIMPLE_BOX && s->face->box_color) |
| 2654 | { | 2657 | { |
| 2655 | xassert (s->face->box_color != nil); | ||
| 2656 | ns_draw_box (r, abs (thickness), | 2658 | ns_draw_box (r, abs (thickness), |
| 2657 | ns_lookup_indexed_color (face->box_color, s->f), | 2659 | ns_lookup_indexed_color (face->box_color, s->f), |
| 2658 | left_p, right_p); | 2660 | left_p, right_p); |