summaryrefslogtreecommitdiffstats
path: root/libass/ass_bitmap.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2010-06-27 12:25:46 +0200
committerGrigori Goronzy <greg@blackbox>2010-06-27 12:45:41 +0200
commitcda83a0a6c9c0418e909ac0f27d735845dde85b3 (patch)
tree0c95cd404fddfba6ac58d7462dbc40de0f9f5945 /libass/ass_bitmap.c
parent0017fffe84a10a6ed6f7dcdaa1b81ae3bc3a2eb1 (diff)
downloadlibass-cda83a0a6c9c0418e909ac0f27d735845dde85b3.tar.bz2
libass-cda83a0a6c9c0418e909ac0f27d735845dde85b3.tar.xz
Simple optimizations to memory handling
Diffstat (limited to 'libass/ass_bitmap.c')
-rw-r--r--libass/ass_bitmap.c5
1 files changed, 2 insertions, 3 deletions
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;