]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/xterm.c (x_term_init): Avoid freeze with 24-bit visuals.
authorPo Lu <luangruo@yahoo.com>
Mon, 31 Jan 2022 10:08:07 +0000 (18:08 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 31 Jan 2022 10:08:07 +0000 (18:08 +0800)
src/xterm.c

index dc4e53759e80b4c7be74961a9a8e77abe3e51201..12f3c0a9d17887673819c34f66d562a82011929b 100644 (file)
@@ -15578,9 +15578,13 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
 #ifdef HAVE_XRENDER
       if (dpyinfo->pict_format)
        {
-         get_bits_and_offset (((unsigned long) dpyinfo->pict_format->direct.alphaMask
-                               << dpyinfo->pict_format->direct.alpha),
-                              &dpyinfo->alpha_bits, &dpyinfo->alpha_offset);
+         unsigned long channel_mask
+           = ((unsigned long) dpyinfo->pict_format->direct.alphaMask
+              << dpyinfo->pict_format->direct.alpha);
+
+         if (channel_mask)
+           get_bits_and_offset (channel_mask, &dpyinfo->alpha_bits,
+                                &dpyinfo->alpha_offset);
        }
       else
 #endif