diff options
author | Grigori Goronzy <greg@hein> | 2009-08-29 20:26:20 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@hein> | 2009-08-29 20:26:20 +0200 |
commit | 7a3f45457b04977ea3d8a59ad66f802fadd43fcb (patch) | |
tree | cb6da8b1897bc553fa779d0f0914e35b437b78ad /libass/ass_drawing.c | |
parent | 2441b10de97b3d52c7d2d2f5f0c92d648e41585d (diff) | |
download | libass-7a3f45457b04977ea3d8a59ad66f802fadd43fcb.tar.bz2 libass-7a3f45457b04977ea3d8a59ad66f802fadd43fcb.tar.xz |
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.
Diffstat (limited to 'libass/ass_drawing.c')
-rw-r--r-- | libass/ass_drawing.c | 6 |
1 files changed, 4 insertions, 2 deletions
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++; + } } /* |