From dc54798b330f9e9419f89b1fcf5e32793478d573 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Fri, 6 Nov 2009 19:33:33 -0800 Subject: [PATCH] don't generate align zones for unused fonts. fixed some mem leaks. --- lib/modules/swfalignzones.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/modules/swfalignzones.c b/lib/modules/swfalignzones.c index d58cea2..81e1992 100644 --- a/lib/modules/swfalignzones.c +++ b/lib/modules/swfalignzones.c @@ -60,6 +60,7 @@ static void find_best(float*_row, int width, int*_x1, int*_x2, int min_size, int } row[t] = sum; } + free(filter); for(t=from;t<=to;t++) { if(row[t]>max1) { @@ -107,7 +108,6 @@ static void find_best(float*_row, int width, int*_x1, int*_x2, int min_size, int *_x2=x2; } - free(row); } @@ -192,7 +192,7 @@ void swf_FontCreateAlignZones(SWFFONT * f) f->alignzones = (ALIGNZONE*)rfx_calloc(sizeof(ALIGNZONE)*f->numchars); f->alignzone_flags = FONTALIGN_MEDIUM; - if(!f->layout) { + if(!f->layout || !f->use) { int t; for(t=0;tnumchars;t++) { // just align the baseline @@ -231,6 +231,9 @@ void swf_FontCreateAlignZones(SWFFONT * f) negate_y(&b); f->alignzones[t] = detect_for_char(f, t, row, column, bounds, b); } + free(row); + free(column_global); + free(column); } } -- 1.7.10.4