]> granicus.if.org Git - libass/commitdiff
Handle allocation failure of clipped bitmaps
authorGrigori Goronzy <greg@blackbox>
Sun, 1 Aug 2010 03:22:18 +0000 (05:22 +0200)
committerGrigori Goronzy <greg@blackbox>
Sun, 1 Aug 2010 03:22:18 +0000 (05:22 +0200)
libass/ass_render.c

index 974d0ed0ddef0354cfafdd82c4d9d01b82b6c6d5..5a1073fc6777c0c603804bb037f8e031d01cd42b 100644 (file)
@@ -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