From 60c950ac0859f93956eeab597b7cff95600fae6a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 22 May 2012 23:58:46 +0200 Subject: [PATCH] dwt: use av_freep() Signed-off-by: Michael Niedermayer --- libavcodec/dwt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/dwt.c b/libavcodec/dwt.c index 100aef535d..748bd40f32 100644 --- a/libavcodec/dwt.c +++ b/libavcodec/dwt.c @@ -39,7 +39,7 @@ void ff_slice_buffer_init(slice_buffer *buf, int line_count, return AVERROR(ENOMEM); buf->data_stack = av_malloc(sizeof(IDWTELEM *) * max_allocated_lines); if (!buf->data_stack) { - av_free(buf->line); + av_freep(&buf->line); return AVERROR(ENOMEM); } @@ -47,9 +47,9 @@ void ff_slice_buffer_init(slice_buffer *buf, int line_count, buf->data_stack[i] = av_malloc(sizeof(IDWTELEM) * line_width); if (!buf->data_stack[i]) { for (i--; i >=0; i--) - av_free(buf->data_stack[i]); - av_free(buf->data_stack); - av_free(buf->line); + av_freep(&buf->data_stack[i]); + av_freep(&buf->data_stack); + av_freep(&buf->line); return AVERROR(ENOMEM); } }