diff options
author | Dr.Smile <vabnick@gmail.com> | 2014-08-26 03:05:42 +0400 |
---|---|---|
committer | Dr.Smile <vabnick@gmail.com> | 2014-08-26 03:50:51 +0400 |
commit | 8a5830af3ee3c1f9c3d4857c4c93606c7e01d967 (patch) | |
tree | 573e5de1a210ad52660de81da0cdae01724fb4a0 | |
parent | 5233036aa98d77017c067bcfd397b88167cf4d79 (diff) | |
download | libass-8a5830af3ee3c1f9c3d4857c4c93606c7e01d967.tar.bz2 libass-8a5830af3ee3c1f9c3d4857c4c93606c7e01d967.tar.xz |
Correctly close last contour in case of overflow
-rw-r--r-- | libass/ass_drawing.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |