From dc17b79e1acec15b1dcbfb669a4a46db08cd4656 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Mon, 9 Mar 2026 22:53:06 -0400 Subject: [PATCH] [base] Reintroduce overall rendering limits. * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Limit absolute outline coordinnates to prevent integer issues downstream. --- src/base/ftobjs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 60a577ea7..cbd30e523 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -499,10 +499,12 @@ /* Flag the width or height unsuitable for rendering. */ /* The limit is based on the ppem value when available. */ /* FT_Renderer modules should check the return value. */ - ret = FT_BOOL( width >= 0x10000 || height >= 0x10000 || - ( slot->face && - ( width > 10 * slot->face->size->metrics.x_ppem || - height > 10 * slot->face->size->metrics.y_ppem ) ) ); + ret = FT_BOOL( width >= 0x10000 || height >= 0x10000 || + pbox.xMin < -0x1000000 || pbox.xMax >= 0x1000000 || + pbox.yMin < -0x1000000 || pbox.yMax >= 0x1000000 || + ( slot->face && + ( width > 10 * slot->face->size->metrics.x_ppem || + height > 10 * slot->face->size->metrics.y_ppem ) ) ); if ( ret ) FT_TRACE3(( "ft_glyphslot_preset_bitmap: [%ld %ld %ld %ld]\n",