tdf#121119 master docs at-page anchor: clean-up renaming
[LibreOffice.git] / external / cairo / pixman / pixman-ubsan.patch
blobb4b1d43adb180653814f2b4f308508dc374dc1ab
1 diff -ru pixman-0.42.2.orig/pixman/pixman-bits-image.c pixman-0.42.2/pixman/pixman-bits-image.c
2 --- misc/pixman-0.42.2.orig/pixman/pixman-bits-image.c 2022-11-03 02:25:48.000000000 +0900
3 +++ misc/build/pixman-0.42.2/pixman/pixman-bits-image.c 2022-11-28 21:35:25.896969126 +0900
4 @@ -351,8 +351,8 @@
5 * positioned relative to a particular phase (and not relative to whatever
6 * exact fraction we happen to get here).
7 */
8 - x = ((x >> x_phase_shift) << x_phase_shift) + ((1 << x_phase_shift) >> 1);
9 - y = ((y >> y_phase_shift) << y_phase_shift) + ((1 << y_phase_shift) >> 1);
10 + x = ((uint32_t)(x >> x_phase_shift) << x_phase_shift) + ((1 << x_phase_shift) >> 1);
11 + y = ((uint32_t)(y >> y_phase_shift) << y_phase_shift) + ((1 << y_phase_shift) >> 1);
13 px = (x & 0xffff) >> x_phase_shift;
14 py = (y & 0xffff) >> y_phase_shift;
15 diff -ru pixman-0.42.2.orig/pixman/pixman-combine32.c pixman-0.42.2/pixman/pixman-combine32.c
16 --- misc/pixman-0.42.2.orig/pixman/pixman-combine32.c 2022-02-02 05:51:25.000000000 +0900
17 +++ misc/build/pixman-0.42.2/pixman/pixman-combine32.c 2022-11-28 21:38:48.226968594 +0900
18 @@ -589,7 +589,7 @@
19 rg = DIV_ONE_UN8 (rg); \
20 rb = DIV_ONE_UN8 (rb); \
22 - *(dest + i) = ra << 24 | rr << 16 | rg << 8 | rb; \
23 + *(dest + i) = (uint32_t)ra << 24 | rr << 16 | rg << 8 | rb; \
24 } \
25 } \
27 diff -ru pixman-0.42.2.orig/pixman/pixman-fast-path.c pixman-0.42.2/pixman/pixman-fast-path.c
28 --- misc/pixman-0.42.2.orig/pixman/pixman-fast-path.c 2022-10-18 02:47:42.000000000 +0900
29 +++ misc/build/pixman-0.42.2/pixman/pixman-fast-path.c 2022-11-28 21:53:12.596963317 +0900
30 @@ -2758,8 +2758,8 @@
31 * positioned relative to a particular phase (and not relative to whatever
32 * exact fraction we happen to get here).
34 - x = ((vx >> x_phase_shift) << x_phase_shift) + ((1 << x_phase_shift) >> 1);
35 - y = ((vy >> y_phase_shift) << y_phase_shift) + ((1 << y_phase_shift) >> 1);
36 + x = ((uint32_t)(vx >> x_phase_shift) << x_phase_shift) + ((1 << x_phase_shift) >> 1);
37 + y = ((uint32_t)(vy >> y_phase_shift) << y_phase_shift) + ((1 << y_phase_shift) >> 1);
39 px = (x & 0xffff) >> x_phase_shift;
40 py = (y & 0xffff) >> y_phase_shift;
41 @@ -2837,9 +2837,9 @@
42 sbtot = CLIP (sbtot, 0, 0xff);
44 #ifdef WORDS_BIGENDIAN
45 - buffer[k] = (satot << 0) | (srtot << 8) | (sgtot << 16) | (sbtot << 24);
46 + buffer[k] = (satot << 0) | (srtot << 8) | (sgtot << 16) | ((uint32_t)sbtot << 24);
47 #else
48 - buffer[k] = (satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot << 0);
49 + buffer[k] = ((uint32_t)satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot << 0);
50 #endif
52 next:
53 diff -ru pixman-0.42.2.orig/pixman/pixman-sse2.c pixman-0.42.2/pixman/pixman-sse2.c
54 --- misc/pixman-0.42.2/pixman/pixman-sse2.c 2022-02-02 05:51:25.000000000 +0900
55 +++ misc/build/pixman-0.42.2/pixman/pixman-sse2.c 2022-11-28 22:11:19.276969466 +0900
56 @@ -516,7 +516,7 @@
59 static force_inline uint32_t
60 -combine1 (const uint32_t *ps, const uint32_t *pm)
61 +combine1 (const void *ps, const uint32_t *pm)
63 uint32_t s;
64 memcpy(&s, ps, sizeof(uint32_t));
65 @@ -3345,7 +3345,7 @@
67 b = filler & 0xff;
68 w = (b << 8) | b;
69 - filler = (w << 16) | w;
70 + filler = ((uint32_t)w << 16) | w;
72 else if (bpp == 16)
74 diff -ru pixman-0.42.2.orig/pixman/pixman-utils.c pixman-0.42.2/pixman/pixman-utils.c
75 --- misc/pixman-0.42.2.orig/pixman/pixman-utils.c 2022-02-02 05:51:25.000000000 +0900
76 +++ misc/build/pixman-0.42.2/pixman/pixman-utils.c 2022-11-28 21:55:44.196964912 +0900
77 @@ -213,7 +213,7 @@
78 g = float_to_unorm (src[i].g, 8);
79 b = float_to_unorm (src[i].b, 8);
81 - dst[i] = (a << 24) | (r << 16) | (g << 8) | (b << 0);
82 + dst[i] = ((uint32_t)a << 24) | (r << 16) | (g << 8) | (b << 0);