Check alignment of 'src' pointer in optimized ARM routines
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 5 Dec 2008 16:45:03 +0000 (11:45 -0500)
committerJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 5 Dec 2008 16:45:03 +0000 (11:45 -0500)
fbCompositeSrcAdd_8000x8000arm() tries to align 'dst' already but must check
'src' too.  Otherwise, the next 4-byte copy loop might access an odd 'src' address
causing an alignment trap.

Patch from Enrico Scholz

pixman/pixman-arm-simd.c

index 8aa81d2b84139478f24b547162d28a7e43adc764..f5953259fb0984621028a4bb021cbf4fbe0845d1 100644 (file)
@@ -60,7 +60,7 @@ fbCompositeSrcAdd_8000x8000arm (pixman_op_t op,
        srcLine += srcStride;
        w = width;
 
-       while (w && (unsigned long)dst & 3)
+       while (w && (((unsigned long)dst & 3) || ((unsigned long)src & 3)))
        {
            s = *src;
            d = *dst;