* src/psaux/psintrp.c (cf2_interpT2CharString): Fix off-by-one in the subroutine nesting depth check.

Fixes #1432.
This commit is contained in:
Mateusz Jurczyk 2026-05-07 13:16:55 +00:00
parent 1ec3406aef
commit 968af86bec

View file

@ -988,8 +988,8 @@
FT_TRACE4(( "%s", op1 == cf2_cmdCALLGSUBR ? " callgsubr"
: " callsubr" ));
if ( ( !font->isT1 && charstringIndex > CF2_MAX_SUBR ) ||
( font->isT1 && charstringIndex > T1_MAX_SUBRS_CALLS ) )
if ( ( !font->isT1 && charstringIndex >= CF2_MAX_SUBR ) ||
( font->isT1 && charstringIndex >= T1_MAX_SUBRS_CALLS ) )
{
/* max subr plus one for charstring */
lastError = FT_THROW( Invalid_Glyph_Format );