sfnt2fon: Avoid out-of-bounds read (AddressSanitizer).

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45422
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Anton Baskanov 2021-08-29 21:06:23 +07:00 committed by Alexandre Julliard
parent 3a54b3413d
commit 2e26090838

View file

@ -743,7 +743,7 @@ static struct fontinfo *fill_fontinfo( const char *face_name, int ppem, int enc,
for(x = 0; x < ((info->dfCharTable[i].width + 7) / 8); x++) {
for(y = 0; y < ppem; y++) {
if(y < ascent - face->glyph->bitmap_top ||
y >= face->glyph->bitmap.rows + ascent - face->glyph->bitmap_top) {
y >= (int)face->glyph->bitmap.rows + ascent - face->glyph->bitmap_top) {
info->data[data_pos++] = 0;
continue;
}