]> granicus.if.org Git - libass/commitdiff
Correctly close last contour in case of overflow
authorDr.Smile <vabnick@gmail.com>
Mon, 25 Aug 2014 23:05:42 +0000 (03:05 +0400)
committerDr.Smile <vabnick@gmail.com>
Mon, 25 Aug 2014 23:50:51 +0000 (03:50 +0400)
libass/ass_drawing.c

index fec9de2f671134b72d6d90430f8f06e5a0a418ac..f94d0e494234f5a9fe41db3dcc4e73de938e2aae 100644 (file)
@@ -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;