summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2023-12-13 08:15:49 +0000
committerSimon Ser <contact@emersion.fr>2023-12-15 13:10:52 +0100
commit86f9162332db88b65a9094991b3ff0e21400426a (patch)
treee720a692ff09a54f13ac0ed338cb5f1a0e71afec
parentb4b789df5b39cecdb598b35a3aa2ca9637029564 (diff)
Fix alignment problem in pixman-fast-path.c
The variable is accessed through uint32_t pointer, so it needs to be aligned to avoid undefined behavior (crashes on architectures which require aligned accesses). Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/84
-rw-r--r--pixman/pixman-fast-path.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index 4579fce..e62a8ac 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -2848,7 +2848,7 @@ bits_image_fetch_separable_convolution_affine (pixman_image_t * image,
}
}
-static const uint8_t zero[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+static const uint32_t zero[2] = { 0, 0 };
static force_inline void
bits_image_fetch_bilinear_affine (pixman_image_t * image,
@@ -2948,7 +2948,7 @@ bits_image_fetch_bilinear_affine (pixman_image_t * image,
if (y2 == 0)
{
- row1 = zero;
+ row1 = (const uint8_t *)zero;
mask1 = 0;
}
else
@@ -2961,7 +2961,7 @@ bits_image_fetch_bilinear_affine (pixman_image_t * image,
if (y1 == height - 1)
{
- row2 = zero;
+ row2 = (const uint8_t *)zero;
mask2 = 0;
}
else