# HG changeset patch # User Andrew Innes # Date 977410689 0 # Node ID 9c0d7d8966820d7efa3b8dcac74bbcfef596c2c4 # Parent 92d61d3599ffa8d2238928584d76a156114355f2 (select_palette): Avoid calling SelectPalette if palette is NULL, since this corrupts memory! Also get display_info reference from frame. diff -r 92d61d3599ff -r 9c0d7d896682 src/w32xfns.c --- a/src/w32xfns.c Thu Dec 21 14:46:37 2000 +0000 +++ b/src/w32xfns.c Thu Dec 21 14:58:09 2000 +0000 @@ -84,9 +84,17 @@ 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;