diff --git a/src/vector/freetype/v_ft_stroker.cpp b/src/vector/freetype/v_ft_stroker.cpp index 3160f84f..e53f51da 100644 --- a/src/vector/freetype/v_ft_stroker.cpp +++ b/src/vector/freetype/v_ft_stroker.cpp @@ -18,6 +18,7 @@ #include "v_ft_stroker.h" #include +#include #include #include #include "v_ft_math.h" @@ -626,6 +627,8 @@ static SW_FT_Error ft_stroke_border_get_counts(SW_FT_StrokeBorder border, static void ft_stroke_border_export(SW_FT_StrokeBorder border, SW_FT_Outline* outline) { + if ((unsigned long)outline->n_points + border->num_points > SHRT_MAX) return; + /* copy point locations */ memcpy(outline->points + outline->n_points, border->points, border->num_points * sizeof(SW_FT_Vector));