From cda83a0a6c9c0418e909ac0f27d735845dde85b3 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sun, 27 Jun 2010 12:25:46 +0200 Subject: Simple optimizations to memory handling --- libass/ass_bitmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libass/ass_bitmap.c') diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index c7c039d..93f2aa8 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -139,8 +139,8 @@ void ass_synth_done(ASS_SynthPriv *priv) static Bitmap *alloc_bitmap(int w, int h) { Bitmap *bm; - bm = calloc(1, sizeof(Bitmap)); - bm->buffer = malloc(w * h); + bm = malloc(sizeof(Bitmap)); + bm->buffer = calloc(w, h); bm->w = w; bm->h = h; bm->left = bm->top = 0; @@ -213,7 +213,6 @@ static Bitmap *glyph_to_bitmap_internal(ASS_Library *library, w = bit->width; h = bit->rows; bm = alloc_bitmap(w + 2 * bord, h + 2 * bord); - memset(bm->buffer, 0, bm->w * bm->h); bm->left = bg->left - bord; bm->top = -bg->top - bord; -- cgit v1.2.3