[Xcb] Bug in image handling on PPC

Ulrich Eckhardt doomster at knuut.de
Wed Jul 30 21:34:14 PDT 2008

Short update on the matter:

I have found that swap_image is called with byte_order={3,2,1,0} but with a 
unit_bytes=1. Somehow, that doesn't make sense to me, I'd even go so far that 
when unit_bytes=1, the only possible byte order is {0} (the other three 
values are irrelevant) and when unit_bytes=2 the two possible ones would be 
{0,1} and {1,0}. Replacing the byte_order with {0} fixes my problems.

Further, inside function swap_image(), there is this code:

   if (d > dst_stride)

This doesn't make sense to me. 'd' is the computed offset to the startaddress 
of the current destination line. This code seems to check if the destination 
offset is out of bounds, but IMHO it fails for two reasons:
1. It should be >=, i.e. a classical off-by-one error.
2. If this applies, I would say that something went wrong anyway, i.e. the 
target image is simply not the right size.


More information about the Xcb mailing list