]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fx_display_color_cells): Force 24+ bit color depths to 24-bit.
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 8 Mar 2002 16:22:37 +0000 (16:22 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 8 Mar 2002 16:22:37 +0000 (16:22 +0000)
src/w32fns.c

index ea5bd5be13874dd4d9edea7be6b076ba00ddd38b..daaaf862f032c483b3425771846acfd20b706371 100644 (file)
@@ -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);