summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-31 20:22:24 +0200
committerwm4 <wm4@nowhere>2014-08-31 20:22:24 +0200
commitca24d7aa9a26a90cc4dfb89406e0e9d14ffb1705 (patch)
tree5ad507ee64bc50fac149062868a299ffaa5e25fd
parent8a5830af3ee3c1f9c3d4857c4c93606c7e01d967 (diff)
downloadlibass-ca24d7aa9a26a90cc4dfb89406e0e9d14ffb1705.tar.bz2
libass-ca24d7aa9a26a90cc4dfb89406e0e9d14ffb1705.tar.xz
Check FT_Outline_New return value
Makes #131 not crash. The function likely fails because the number of points exceeds SHRT_MAX.
-rw-r--r--libass/ass_render.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 419dc7b..832ba79 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1008,8 +1008,13 @@ static void stroke_outline(ASS_Renderer *render_priv, FT_Outline *outline,
"FT_Stroker_GetBorderCounts failed, error: %d", error);
}
FT_Outline_Done(render_priv->ftlibrary, outline);
- FT_Outline_New(render_priv->ftlibrary, n_points, n_contours, outline);
+ error = FT_Outline_New(render_priv->ftlibrary, n_points, n_contours, outline);
outline->n_points = outline->n_contours = 0;
+ if (error) {
+ ass_msg(render_priv->library, MSGL_WARN,
+ "FT_Outline_New failed, error: %d", error);
+ return;
+ }
FT_Stroker_ExportBorder(render_priv->state.stroker, border, outline);
// "Stroke" with the outline emboldener (in two passes if needed).