summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@hein>2009-08-29 20:26:20 +0200
committerGrigori Goronzy <greg@hein>2009-08-29 20:26:20 +0200
commit7a3f45457b04977ea3d8a59ad66f802fadd43fcb (patch)
treecb6da8b1897bc553fa779d0f0914e35b437b78ad
parent2441b10de97b3d52c7d2d2f5f0c92d648e41585d (diff)
downloadlibass-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.
-rw-r--r--libass/ass_drawing.c6
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++;
+ }
}
/*