xserver-multidpi/mi
Keith Packard 11e2f0de71 mi: miPutImage with XYPixmap failed at depth 32 on 64-bit machines
The X server still has 'unsigned long' in a few places to hold 32 bit
values. One of those is in miPutImage where it's holding the temporary
planemask for XYPixmap format images.

It computed the highest plane in the source image with 1 << (depth -
1). On 64-bit machines, taking that value and storing it in an
unsigned long promotes it to a signed 64-bit value
(0xffffffff80000000).

Then, it loops over that value, shifting one bit right each time,
waiting for it to go to zero.. That takes 64 iterations, and ends up
with some mystic planemask values *and* walking off the end of the
source image data and out into space.

A simple cast is all that is required to compute the correct initial
plane mask (0x0000000080000000), at which point the loop operates
correctly once again.

Checking the fbPutImage code, I note that this same bug was fixed
in 2006 by Aaron Plattner in commit
f39fd42429

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2014-03-26 12:58:40 -07:00
..
Makefile.am dix: Delete mibstore.h 2012-09-23 10:31:55 -07:00
mi.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
miarc.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
mibitblt.c mi: miPutImage with XYPixmap failed at depth 32 on 64-bit machines 2014-03-26 12:58:40 -07:00
micmap.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
micmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
micoord.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
micopy.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
micursor.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
midash.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
midispcur.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
mieq.c mi: fix printf warning about size_t format specifier 2014-02-10 07:02:34 +10:00
miexpose.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
mifillarc.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mifillarc.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mifillrct.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mifpoly.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mifpolycon.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
migc.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
migc.h Clean up a few function prototypes to not place formals in /**/ 2014-01-12 10:24:12 -08:00
miglblt.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
miinitext.c miinitext: introduce LoadExtensionList() to replace over LoadExtension() 2014-03-25 16:00:17 -07:00
miline.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mioverlay.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
mioverlay.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mipointer.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
mipointer.h mipointer: Remove deprecated miPointerCurrentScreen 2013-09-10 13:29:21 -04:00
mipointrst.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mipoly.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mipoly.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mipolycon.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mipolygen.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mipolypnt.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mipolyrect.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
mipolyseg.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mipolytext.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mipolyutil.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mipushpxl.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
miscanfill.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
miscrinit.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
mispans.c mi: fix shadow warnings 2012-11-05 13:25:02 -06:00
mispans.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
misprite.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
misprite.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mistruct.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mivalidate.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mivaltree.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
miwideline.c mi: Avoid stack smash when drawing dashed lines 2013-09-10 13:26:25 -04:00
miwideline.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
miwindow.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
mizerarc.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mizerarc.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mizerclip.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
mizerline.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00