diff options
Diffstat (limited to 'libass/ass_bitmap.c')
-rw-r--r-- | libass/ass_bitmap.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index 9211a7c0..522bce7c 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -113,8 +113,7 @@ static void resize_tmp(ASS_SynthPriv *priv, int w, int h) priv->tmp_w *= 2; while (priv->tmp_h < h) priv->tmp_h *= 2; - if (priv->tmp) - free(priv->tmp); + free(priv->tmp); priv->tmp = malloc((priv->tmp_w + 1) * priv->tmp_h * sizeof(short)); } @@ -127,12 +126,9 @@ ASS_SynthPriv *ass_synth_init(double radius) void ass_synth_done(ASS_SynthPriv *priv) { - if (priv->tmp) - free(priv->tmp); - if (priv->g) - free(priv->g); - if (priv->gt2) - free(priv->gt2); + free(priv->tmp); + free(priv->g); + free(priv->gt2); free(priv); } @@ -149,11 +145,9 @@ static Bitmap *alloc_bitmap(int w, int h) void ass_free_bitmap(Bitmap *bm) { - if (bm) { - if (bm->buffer) - free(bm->buffer); - free(bm); - } + if (bm) + free(bm->buffer); + free(bm); } static Bitmap *copy_bitmap(const Bitmap *src) |