changeset 43773:8d3931ead0df

(Fx_display_color_cells): Force 24+ bit color depths to 24-bit.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 08 Mar 2002 08:33:30 +0000
parents c8b075cfe7eb
children 88569453a212
files src/w32fns.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32fns.c	Fri Mar 08 08:21:16 2002 +0000
+++ b/src/w32fns.c	Fri Mar 08 08:33:30 2002 +0000
@@ -7768,8 +7768,10 @@
   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);