diff options
author | Adam Jackson <ajax@redhat.com> | 2014-04-10 11:45:37 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-04-21 21:39:43 -0700 |
commit | f466fb2432292d74123d701764c432d3aa75ef1d (patch) | |
tree | df4359823bb2336d7e921bff224dcda8d8b1f6e2 /Xext/xres.c | |
parent | 5df66822c9f6bac1ed3952971958068600ccd095 (diff) |
xres: Fix size estimation for <8bpp pixmaps (#69057)
Just use floats, it's not like this is a performance path.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xext/xres.c')
-rw-r--r-- | Xext/xres.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Xext/xres.c b/Xext/xres.c index b26cbb5c5..546b942a1 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -353,9 +353,9 @@ static unsigned long ResGetApproxPixmapBytes(PixmapPtr pix) { unsigned long nPixels; - int bytesPerPixel; + float bytesPerPixel; - bytesPerPixel = pix->drawable.bitsPerPixel >> 3; + bytesPerPixel = (float)pix->drawable.bitsPerPixel / 8.0; nPixels = pix->drawable.width * pix->drawable.height; /* Divide by refcnt as pixmap could be shared between clients, |