aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Innes2000-12-21 14:58:09 +0000
committerAndrew Innes2000-12-21 14:58:09 +0000
commit90f4a9f8e2a4424d1ff19208aa088cfdf6fa4df9 (patch)
tree856a6cb87c6d7873fe84ae610f47ca3728076cde /src
parent834d23b2c4495d76d711f0a7e628f17e4781758d (diff)
downloademacs-90f4a9f8e2a4424d1ff19208aa088cfdf6fa4df9.tar.gz
emacs-90f4a9f8e2a4424d1ff19208aa088cfdf6fa4df9.zip
(select_palette): Avoid calling SelectPalette if
palette is NULL, since this corrupts memory! Also get display_info reference from frame.
Diffstat (limited to 'src')
-rw-r--r--src/w32xfns.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 018aefdf35e..9117f7e91a9 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -84,9 +84,17 @@ signal_quit ()
84void 84void
85select_palette (FRAME_PTR f, HDC hdc) 85select_palette (FRAME_PTR f, HDC hdc)
86{ 86{
87 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f);
88
89 if (!display_info->has_palette)
90 return;
91
92 if (display_info->palette == 0)
93 abort ();
94
87 if (!NILP (Vw32_enable_palette)) 95 if (!NILP (Vw32_enable_palette))
88 f->output_data.w32->old_palette = 96 f->output_data.w32->old_palette =
89 SelectPalette (hdc, one_w32_display_info.palette, FALSE); 97 SelectPalette (hdc, display_info->palette, FALSE);
90 else 98 else
91 f->output_data.w32->old_palette = NULL; 99 f->output_data.w32->old_palette = NULL;
92 100