summaryrefslogtreecommitdiff
path: root/src/cache
diff options
context:
space:
mode:
authorDaniel Welty <@danielwelty>2021-04-17 09:00:40 -0400
committerAlexei Podtelezhnikov <apodtele@gmail.com>2021-04-17 09:00:40 -0400
commit2e68785e08a409ca16427924b1e34740339f09a7 (patch)
treee32e23f76df1b601edd44bed5372734dd5b71817 /src/cache
parent6f6ad876383694e0e50799a577f8a08241096faf (diff)
downloadfreetype2-2e68785e08a409ca16427924b1e34740339f09a7.tar.gz
* src/cache/ftcsbits.c (ftc_snode_load): Properly handle short pitch.
Diffstat (limited to 'src/cache')
-rw-r--r--src/cache/ftcsbits.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index 8ec76c54f..93d5367fa 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -143,12 +143,13 @@
goto BadGlyph;
}
- /* Check whether our values fit into 8-bit containers! */
+ /* Check whether our values fit into 8/16-bit containers! */
/* If this is not the case, our bitmap is too large */
/* and we will leave it as `missing' with sbit.buffer = 0 */
#define CHECK_CHAR( d ) ( temp = (FT_Char)d, (FT_Int) temp == (FT_Int) d )
#define CHECK_BYTE( d ) ( temp = (FT_Byte)d, (FT_UInt)temp == (FT_UInt)d )
+#define CHECK_SHRT( d ) ( temp = (FT_Short)d, (FT_Int)temp == (FT_Int) d )
/* horizontal advance in pixels */
xadvance = ( slot->advance.x + 32 ) >> 6;
@@ -156,7 +157,7 @@
if ( !CHECK_BYTE( bitmap->rows ) ||
!CHECK_BYTE( bitmap->width ) ||
- !CHECK_CHAR( bitmap->pitch ) ||
+ !CHECK_SHRT( bitmap->pitch ) ||
!CHECK_CHAR( slot->bitmap_left ) ||
!CHECK_CHAR( slot->bitmap_top ) ||
!CHECK_CHAR( xadvance ) ||
@@ -169,7 +170,7 @@
sbit->width = (FT_Byte)bitmap->width;
sbit->height = (FT_Byte)bitmap->rows;
- sbit->pitch = (FT_Char)bitmap->pitch;
+ sbit->pitch = (FT_Short)bitmap->pitch;
sbit->left = (FT_Char)slot->bitmap_left;
sbit->top = (FT_Char)slot->bitmap_top;
sbit->xadvance = (FT_Char)xadvance;