From 0f5cfdc3136dd8ef43800bda64f9d39e6b23b2e9 Mon Sep 17 00:00:00 2001
From: Julien Cristau <jcristau@debian.org>
Date: Sun, 30 Jun 2013 20:09:49 +0200
Subject: Compute number of bytes correctly in XResQueryClientPixmapBytes

64-bit servers send the upper 32-bit in bytes_overflow.  We were
multiplying by 2^32 - 1 instead of 2^32 when putting things back
together.

Debian bug#621702

Reported-by: Kevin Ryde <user42@zip.com.au>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>

Index: libxres/src/XRes.c
===================================================================
--- libxres.orig/src/XRes.c
+++ libxres/src/XRes.c
@@ -239,7 +239,7 @@ Status XResQueryClientPixmapBytes (
     }
 
 #ifdef LONG64
-    *bytes = (rep.bytes_overflow * 4294967295) + rep.bytes;
+    *bytes = (rep.bytes_overflow * 4294967296UL) + rep.bytes;
 #else
     *bytes = rep.bytes_overflow ? 0xffffffff : rep.bytes;
 #endif
