Commit 90f4a9f8 authored by Andrew Innes's avatar Andrew Innes

(select_palette): Avoid calling SelectPalette if

palette is NULL, since this corrupts memory!  Also get
display_info reference from frame.
parent 834d23b2
......@@ -84,9 +84,17 @@ signal_quit ()
void
select_palette (FRAME_PTR f, HDC hdc)
{
struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f);
if (!display_info->has_palette)
return;
if (display_info->palette == 0)
abort ();
if (!NILP (Vw32_enable_palette))
f->output_data.w32->old_palette =
SelectPalette (hdc, one_w32_display_info.palette, FALSE);
SelectPalette (hdc, display_info->palette, FALSE);
else
f->output_data.w32->old_palette = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment