Fixed invalid casting in arm_neon_fill

Submitted by Mizuki Asakura on April 4, 2016, 10:27 a.m.

Details

Message ID CADqU6iQHfV2rYJK+zoe+RsvBVyQr-5kdgPWES4CKrHUQr27Hkg@mail.gmail.com
State New
Series "Fixed invalid casting in arm_neon_fill"
Headers show

Commit Message

Mizuki Asakura April 4, 2016, 10:27 a.m.
stride con be negative, but byte-stride is declared as uint32_t.
It may cause integer overflow.

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

Patch hide | download patch | download mbox

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)
     {