From 678f1f6b448181d9ccb9b920d91847f40a4d82ef Mon Sep 17 00:00:00 2001 From: "Dr.Smile" Date: Sun, 14 Jun 2015 18:55:41 +0300 Subject: [PATCH] Fix crash when stroked outline overflows SHRT_MAX --- libass/ass_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index c873330..2cfa62a 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1102,7 +1102,7 @@ static void stroke_outline(ASS_Renderer *render_priv, ASS_Outline *outline, outline->n_points = n_points; outline->n_contours = n_contours; for (size_t i = 0; i < n_contours; ++i) - outline->contours[i] = contours[i]; + outline->contours[i] = (unsigned short) contours[i]; // "Stroke" with the outline emboldener (in two passes if needed). // The outlines look uglier, but the emboldening never adds any points -- 2.50.1