# HG changeset patch # User Jason Rumney # Date 975701199 0 # Node ID 59adbaee309264305f435036d6435b9a943cd586 # Parent d554a3ac303953bb42044f17a7baba015ec04655 (get_frame_dc): Avoid changing the palette on an invalid frame. diff -r d554a3ac3039 -r 59adbaee3092 src/w32xfns.c --- a/src/w32xfns.c Fri Dec 01 19:47:36 2000 +0000 +++ b/src/w32xfns.c Fri Dec 01 20:06:39 2000 +0000 @@ -117,7 +117,11 @@ enter_crit (); hdc = GetDC (f->output_data.w32->window_desc); - select_palette (f, hdc); + + /* If this gets called during startup before the frame is valid, + there is a chance of corrupting random data or crashing. */ + if (hdc) + select_palette (f, hdc); return hdc; }