fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / external / jpeg-turbo / ubsan.patch
blob9e90fe1f2fc720c96cb17b58184daf531a16a9d8
1 --- jdhuff.c
2 +++ jdhuff.c
3 @@ -489,7 +489,7 @@
4 #define AVOID_TABLES
5 #ifdef AVOID_TABLES
7 -#define HUFF_EXTEND(x,s) ((x) + ((((x) - (1<<((s)-1))) >> 31) & (((-1)<<(s)) + 1)))
8 +#define HUFF_EXTEND(x,s) ((x) + ((((x) - (1<<((s)-1))) >> 31) & (((unsigned)-1<<(s)) + 1)))
10 #else
12 --- jdphuff.c
13 +++ jdphuff.c
14 @@ -201,7 +201,7 @@
15 #define AVOID_TABLES
16 #ifdef AVOID_TABLES
18 -#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
19 +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((unsigned)-1<<(s)) + 1) : (x))
21 #else
23 @@ -334,7 +334,7 @@
24 s += state.last_dc_val[ci];
25 state.last_dc_val[ci] = s;
26 /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
27 - (*block)[0] = (JCOEF) (s << Al);
28 + (*block)[0] = (JCOEF) ((unsigned)s << Al);
31 /* Completed MCU, so update state */
32 @@ -402,7 +402,7 @@
33 r = GET_BITS(s);
34 s = HUFF_EXTEND(r, s);
35 /* Scale and output coefficient in natural (dezigzagged) order */
36 - (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al);
37 + (*block)[jpeg_natural_order[k]] = (JCOEF) ((unsigned)s << Al);
38 } else {
39 if (r == 15) { /* ZRL */
40 k += 15; /* skip 15 zeroes in band */
41 @@ -494,7 +494,7 @@
42 phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
43 int Se = cinfo->Se;
44 int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
45 - int m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
46 + int m1 = (unsigned)-1 << cinfo->Al; /* -1 in the bit position being coded */
47 register int s, k, r;
48 unsigned int EOBRUN;
49 JBLOCKROW block;