Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
284956b5
by Alexei Podtelezhnikov at 2022-07-26T12:23:15-04:00
1 changed file:
Changes:
... | ... | @@ -486,17 +486,16 @@ |
486 | 486 | kerning->x = 0;
|
487 | 487 | kerning->y = 0;
|
488 | 488 | |
489 | - if ( glyph1 > 0 )
|
|
490 | - glyph1--;
|
|
489 | + /* PFR indexing skips .notdef, which becomes UINT_MAX */
|
|
490 | + glyph1--;
|
|
491 | + glyph2--;
|
|
491 | 492 | |
492 | - if ( glyph2 > 0 )
|
|
493 | - glyph2--;
|
|
494 | - |
|
495 | - /* convert glyph indices to character codes */
|
|
496 | - if ( glyph1 > phy_font->num_chars ||
|
|
497 | - glyph2 > phy_font->num_chars )
|
|
493 | + /* check the array bounds, .notdef is automacally out */
|
|
494 | + if ( glyph1 >= phy_font->num_chars ||
|
|
495 | + glyph2 >= phy_font->num_chars )
|
|
498 | 496 | goto Exit;
|
499 | 497 | |
498 | + /* convert glyph indices to character codes */
|
|
500 | 499 | code1 = phy_font->chars[glyph1].char_code;
|
501 | 500 | code2 = phy_font->chars[glyph2].char_code;
|
502 | 501 | pair = PFR_KERN_INDEX( code1, code2 );
|