diff options
author | Jason Rumney <jasonr@gnu.org> | 2000-12-01 20:11:23 +0000 |
---|---|---|
committer | Jason Rumney <jasonr@gnu.org> | 2000-12-01 20:11:23 +0000 |
commit | 86d1db205f3e806316d87640dac728b1a683719c (patch) | |
tree | 4c0b516a4de7fd0252ae329dcf294b0342471acb /src/w32xfns.c | |
parent | e4a5241280d674124e9dc9cc23d37c1472331641 (diff) |
(get_frame_dc): Avoid changing the palette on an invalid frame.
Diffstat (limited to 'src/w32xfns.c')
-rw-r--r-- | src/w32xfns.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/w32xfns.c b/src/w32xfns.c index 9624e0dd4e..018aefdf35 100644 --- a/src/w32xfns.c +++ b/src/w32xfns.c @@ -117,7 +117,11 @@ get_frame_dc (FRAME_PTR f) 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; } |