From bf18015d3a40c84dedbbc154ccd1d41c3f7944b6 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Mon, 9 Mar 2026 19:53:30 -0400 Subject: [PATCH] [stroker] Actually validate outlines. Fixes #1400. * src/base/ftstroke.c (FT_Glyph_Stroke): Check for `GetCount` error. (ft_stroke_border_get_counts): Actually return expected error. (FT_Glyph_Stroke): Minor. --- src/base/ftstroke.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/base/ftstroke.c b/src/base/ftstroke.c index 591f18eaa..6197d91d6 100644 --- a/src/base/ftstroke.c +++ b/src/base/ftstroke.c @@ -693,6 +693,7 @@ Fail: num_points = 0; num_contours = 0; + error = FT_THROW( Invalid_Outline ); goto Exit; } @@ -2251,7 +2252,7 @@ FT_Stroker stroker, FT_Bool destroy ) { - FT_Error error = FT_ERR( Invalid_Argument ); + FT_Error error = FT_THROW( Invalid_Argument ); FT_Glyph glyph = NULL; @@ -2283,7 +2284,9 @@ if ( error ) goto Fail; - FT_Stroker_GetCounts( stroker, &num_points, &num_contours ); + error = FT_Stroker_GetCounts( stroker, &num_points, &num_contours ); + if ( error ) + goto Fail; FT_Outline_Done( glyph->library, outline ); @@ -2326,7 +2329,7 @@ FT_Bool inside, FT_Bool destroy ) { - FT_Error error = FT_ERR( Invalid_Argument ); + FT_Error error = FT_THROW( Invalid_Argument ); FT_Glyph glyph = NULL;