Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
2e68785e
by Daniel Welty at 2021-04-17T09:00:40-04:00
2 changed files:
Changes:
1 |
+2021-04-16 Daniel Welty <@danielwelty>
|
|
2 |
+ |
|
3 |
+ * src/cache/ftcsbits.c (ftc_snode_load): Properly handle short pitch.
|
|
4 |
+ |
|
1 | 5 |
2021-04-16 Werner Lemberg <wl@gnu.org>
|
2 | 6 |
|
3 | 7 |
* builds/unix/freetype2.m4: Fix help string formatting.
|
... | ... | @@ -143,12 +143,13 @@ |
143 | 143 |
goto BadGlyph;
|
144 | 144 |
}
|
145 | 145 |
|
146 |
- /* Check whether our values fit into 8-bit containers! */
|
|
146 |
+ /* Check whether our values fit into 8/16-bit containers! */
|
|
147 | 147 |
/* If this is not the case, our bitmap is too large */
|
148 | 148 |
/* and we will leave it as `missing' with sbit.buffer = 0 */
|
149 | 149 |
|
150 | 150 |
#define CHECK_CHAR( d ) ( temp = (FT_Char)d, (FT_Int) temp == (FT_Int) d )
|
151 | 151 |
#define CHECK_BYTE( d ) ( temp = (FT_Byte)d, (FT_UInt)temp == (FT_UInt)d )
|
152 |
+#define CHECK_SHRT( d ) ( temp = (FT_Short)d, (FT_Int)temp == (FT_Int) d )
|
|
152 | 153 |
|
153 | 154 |
/* horizontal advance in pixels */
|
154 | 155 |
xadvance = ( slot->advance.x + 32 ) >> 6;
|
... | ... | @@ -156,7 +157,7 @@ |
156 | 157 |
|
157 | 158 |
if ( !CHECK_BYTE( bitmap->rows ) ||
|
158 | 159 |
!CHECK_BYTE( bitmap->width ) ||
|
159 |
- !CHECK_CHAR( bitmap->pitch ) ||
|
|
160 |
+ !CHECK_SHRT( bitmap->pitch ) ||
|
|
160 | 161 |
!CHECK_CHAR( slot->bitmap_left ) ||
|
161 | 162 |
!CHECK_CHAR( slot->bitmap_top ) ||
|
162 | 163 |
!CHECK_CHAR( xadvance ) ||
|
... | ... | @@ -169,7 +170,7 @@ |
169 | 170 |
|
170 | 171 |
sbit->width = (FT_Byte)bitmap->width;
|
171 | 172 |
sbit->height = (FT_Byte)bitmap->rows;
|
172 |
- sbit->pitch = (FT_Char)bitmap->pitch;
|
|
173 |
+ sbit->pitch = (FT_Short)bitmap->pitch;
|
|
173 | 174 |
sbit->left = (FT_Char)slot->bitmap_left;
|
174 | 175 |
sbit->top = (FT_Char)slot->bitmap_top;
|
175 | 176 |
sbit->xadvance = (FT_Char)xadvance;
|