diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2002-03-08 16:22:37 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2002-03-08 16:22:37 +0000 |
commit | f4ae06c5ce4142e58aa6ca9f81b0f9ab8ae1cace (patch) | |
tree | 3a0d9aeda5b5fe0ccc2e5754c8103d60573dafc9 | |
parent | 2af25439ae083f9b7639cb0b3273699a30ef9011 (diff) | |
download | emacs-f4ae06c5ce4142e58aa6ca9f81b0f9ab8ae1cace.tar.gz |
(Fx_display_color_cells): Force 24+ bit color depths to 24-bit.
-rw-r--r-- | src/w32fns.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index ea5bd5be138..daaaf862f03 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7450,8 +7450,10 @@ If omitted or nil, that stands for the selected frame's display.") else cap = GetDeviceCaps (hdc,NUMCOLORS); + /* We force 24+ bit depths to 24-bit, both to prevent an overflow + and because probably is more meaningful on Windows anyway */ if (cap < 0) - cap = 1 << (dpyinfo->n_planes * dpyinfo->n_cbits); + cap = 1 << min(dpyinfo->n_planes * dpyinfo->n_cbits, 24); ReleaseDC (dpyinfo->root_window, hdc); |