From: Juanma Barranquero Date: Fri, 8 Mar 2002 16:22:37 +0000 (+0000) Subject: (Fx_display_color_cells): Force 24+ bit color depths to 24-bit. X-Git-Tag: emacs-21.2~28 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f4ae06c5ce4142e58aa6ca9f81b0f9ab8ae1cace;p=emacs.git (Fx_display_color_cells): Force 24+ bit color depths to 24-bit. --- 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);