From 9663b8912334c5c062eee231f5aa9e68c1b81dcf Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sun, 1 Aug 2010 05:22:18 +0200 Subject: [PATCH] Handle allocation failure of clipped bitmaps --- libass/ass_render.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libass/ass_render.c b/libass/ass_render.c index 974d0ed..5a1073f 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -661,6 +661,7 @@ static void blend_vector_clip(ASS_Renderer *render_priv, // Allocate new buffer and add to free list nbuffer = malloc(as * ah); + if (!nbuffer) goto blend_vector_exit; free_list_add(render_priv, nbuffer); // Blend together @@ -681,6 +682,7 @@ static void blend_vector_clip(ASS_Renderer *render_priv, // Allocate new buffer and add to free list nbuffer = calloc(as, ah); + if (!nbuffer) goto blend_vector_exit; free_list_add(render_priv, nbuffer); // Blend together -- 2.40.0