summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Kew <jfkthame@googlemail.com>2019-08-30 10:42:45 +0000
committerJonathan Kew <jfkthame@googlemail.com>2019-08-30 10:42:45 +0000
commitc558647fdf38f6d881ca924f5930c05c015561c9 (patch)
treeb43a495af54e6f4c8c67fce2d0faf1d1c0ef9ca6
parentfd5c0da57985a430912907d4a898ed1ddb854ead (diff)
downloadpixman-c558647fdf38f6d881ca924f5930c05c015561c9.tar.gz
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)
-rw-r--r--pixman/pixman-sse2.c4
1 files changed, 2 insertions, 2 deletions
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--;
}