From 8a5830af3ee3c1f9c3d4857c4c93606c7e01d967 Mon Sep 17 00:00:00 2001 From: "Dr.Smile" Date: Tue, 26 Aug 2014 03:05:42 +0400 Subject: Correctly close last contour in case of overflow --- libass/ass_drawing.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libass/ass_drawing.c b/libass/ass_drawing.c index fec9de2..f94d0e4 100644 --- a/libass/ass_drawing.c +++ b/libass/ass_drawing.c @@ -58,8 +58,11 @@ static inline void drawing_add_point(ASS_Drawing *drawing, static inline void drawing_close_shape(ASS_Drawing *drawing) { FT_Outline *ol = &drawing->outline; - if (ol->n_contours == SHRT_MAX) + if (ol->n_contours == SHRT_MAX) { + if (ol->n_points) + ol->contours[ol->n_contours] = ol->n_points - 1; return; + } if (ol->n_contours >= drawing->max_contours) { drawing->max_contours *= 2; -- cgit v1.2.3