pixman: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Aug 31 19:38:10 UTC 2019


 pixman/pixman-sse2.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c558647fdf38f6d881ca924f5930c05c015561c9
Author: Jonathan Kew <jfkthame at googlemail.com>
Date:   Fri Aug 30 10:42:45 2019 +0000

    Explicitly cast byte to uint32_t before left-shifting.
    
    To avoid potential signed integer overflow (undefined behavior), as implicit integer promotion means the operand becomes a (signed) int.
    
    (Issue originally reported at https://bugzilla.mozilla.org/show_bug.cgi?id=1577669)

diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 8955103..aa0f84d 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -6410,7 +6410,7 @@ sse2_fetch_a8 (pixman_iter_t *iter, const uint32_t *mask)
 
     while (w && (((uintptr_t)dst) & 15))
     {
-        *dst++ = *(src++) << 24;
+        *dst++ = (uint32_t)(*(src++)) << 24;
         w--;
     }
 
@@ -6437,7 +6437,7 @@ sse2_fetch_a8 (pixman_iter_t *iter, const uint32_t *mask)
 
     while (w)
     {
-	*dst++ = *(src++) << 24;
+	*dst++ = (uint32_t)(*(src++)) << 24;
 	w--;
     }
 


More information about the xorg-commit mailing list