>From 36b9fb3248b029af235045e5d5cf524dbeb95a4e Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 18 Feb 2009 02:18:33 +0100 Subject: [PATCH 03/12] Fix memory leak in blur handling. --- libass/ass_bitmap.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index 0b80d7a..9ccb1ba 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -62,8 +62,8 @@ static int generate_tables(ass_synth_priv_t* priv, double radius) priv->g_w = 2*priv->g_r+1; if (priv->g_r) { - priv->g = malloc(priv->g_w * sizeof(unsigned)); - priv->gt2 = malloc(256 * priv->g_w * sizeof(unsigned)); + priv->g = realloc(priv->g, priv->g_w * sizeof(unsigned)); + priv->gt2 = realloc(priv->gt2, 256 * priv->g_w * sizeof(unsigned)); if (priv->g==NULL || priv->gt2==NULL) { return -1; } @@ -259,6 +259,7 @@ int glyph_to_bitmap(ass_synth_priv_t* priv, ass_synth_priv_t* priv_blur, bitmap_t** bm_o, bitmap_t** bm_s, int be, double blur_radius) { int bord = be ? (be+1) : 0; + blur_radius *= 2; bord = (blur_radius > 0.0) ? blur_radius : bord; assert(bm_g && bm_o && bm_s); -- 1.5.4.3