summaryrefslogtreecommitdiff
path: root/src/w32xfns.c
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2000-12-01 20:11:23 +0000
committerJason Rumney <jasonr@gnu.org>2000-12-01 20:11:23 +0000
commit86d1db205f3e806316d87640dac728b1a683719c (patch)
tree4c0b516a4de7fd0252ae329dcf294b0342471acb /src/w32xfns.c
parente4a5241280d674124e9dc9cc23d37c1472331641 (diff)
(get_frame_dc): Avoid changing the palette on an invalid frame.
Diffstat (limited to 'src/w32xfns.c')
-rw-r--r--src/w32xfns.c6
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;
}