From: Andrew Innes Date: Thu, 21 Dec 2000 14:58:09 +0000 (+0000) Subject: (select_palette): Avoid calling SelectPalette if X-Git-Tag: emacs-pretest-21.0.95~348 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=90f4a9f8e2a4424d1ff19208aa088cfdf6fa4df9;p=emacs.git (select_palette): Avoid calling SelectPalette if palette is NULL, since this corrupts memory! Also get display_info reference from frame. --- 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 () 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;