From: Grigori Goronzy Date: Sat, 29 Aug 2009 18:26:20 +0000 (+0200) Subject: Do not close empty drawings X-Git-Tag: 0.9.8~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a3f45457b04977ea3d8a59ad66f802fadd43fcb;p=libass Do not close empty drawings If there are no points (i.e. illegal drawing), do not close the drawing by incrementing the contour counter. Under certain circumstances, this can crash the FreeType stroker. This fixes issue 7. --- diff --git a/libass/ass_drawing.c b/libass/ass_drawing.c index 95348a2..8c5f062 100644 --- a/libass/ass_drawing.c +++ b/libass/ass_drawing.c @@ -86,8 +86,10 @@ static inline void drawing_close_shape(ASS_Drawing *drawing) drawing->max_contours); } - ol->contours[ol->n_contours] = ol->n_points - 1; - ol->n_contours++; + if (ol->n_points) { + ol->contours[ol->n_contours] = ol->n_points - 1; + ol->n_contours++; + } } /*