Rein Klazes wijn@wanadoo.nl writes:
Fixing bug #4506: unaligned 32bit access, can access one byte beyond the pixel buffer.
Changelog: dlls/x11drv : dib_convert.c Avoid unaligned 32 bit reads, and reads beyond the input pixel buffer in the convert_888_to_0888_* functions.
This will badly hurt performance, you don't want to check alignment on every pixel. You should only check on the first one and copy 1 to 3 pixels as needed to align things properly, then do the 4 pixels at a time thing.
On Tue, 28 Feb 2006 12:38:13 +0100, you wrote:
This will badly hurt performance, you don't want to check alignment on every pixel. You should only check on the first one and copy 1 to 3 pixels as needed to align things properly, then do the 4 pixels at a time thing.
Yes, it was rather optimized for small code ;-)
Here is the result following your suggestion.
Changelog: dlls/x11drv : dib_convert.c Avoid unaligned 32 bit reads, and reads beyond the input pixel buffer in the convert_888_to_0888_* functions.
Rein.
"Rein Klazes" wijn@wanadoo.nl wrote:
- srcpixel = (const DWORD*)((int)srcpixel & 0xfffffffc);
It would be more readable IMO to use ~3 instead of 0xfffffffc.