[Pixman] [PATCH] Fixed invalid casting in arm_neon_fill

Mizuki Asakura ed6e117f at gmail.com
Mon Apr 4 10:27:45 UTC 2016


stride con be negative, but byte-stride is declared as uint32_t.
It may cause integer overflow.

Signed-off-by: Mizuki Asakura <ed6e117f at gmail.com>
---
 pixman/pixman-arm-neon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c
index be761c9..fcb61bc
--- a/pixman/pixman-arm-neon.c
+++ b/pixman/pixman-arm-neon.c
@@ -194,7 +194,7 @@ arm_neon_fill (pixman_implementation_t *imp,
            uint32_t                 _xor)
 {
     /* stride is always multiple of 32bit units in pixman */
-    uint32_t byte_stride = stride * sizeof(uint32_t);
+    int32_t byte_stride = stride * sizeof(uint32_t);

     switch (bpp)
     {
-- 
2.7.4


More information about the Pixman mailing list