CopyArea : bug if areas overlap

Soeren Sandmann sandmann at daimi.au.dk
Thu Feb 4 09:30:51 PST 2010


rixed at happyleptic.org writes:

> There is a fastpath in fbBlt() using memcpy if the source and dest rasters are
> properly aligned. This fastpath rely on MEMCPY_WRAPPED, which is (sometime) a
> mere memcpy().
> 
> So, if the rasters do overlap the behavior is undefined. On my loongson (mips)
> at home, it segfaults, bus error or sometime hangs.
> 
> This is easy to replace this memcpy by a memmove to solve this bug, but I
> wonder if these rasters are actually allowed to overlap ?  

They are allowed to overlap. The 'reverse' and 'upsidedown' arguments
give the direction of the blt, precisely for this reason.

So this is a real bug.



Soren



More information about the xorg mailing list