1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-09 05:01:02 -08:00

(select_palette): Avoid calling SelectPalette if

palette is NULL, since this corrupts memory!  Also get
display_info reference from frame.
This commit is contained in:
Andrew Innes 2000-12-21 14:58:09 +00:00
parent 834d23b2c4
commit 90f4a9f8e2

View file

@ -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;