Commit 60c950ac authored by Michael Niedermayer's avatar Michael Niedermayer

dwt: use av_freep()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ea5dab58
...@@ -39,7 +39,7 @@ void ff_slice_buffer_init(slice_buffer *buf, int line_count, ...@@ -39,7 +39,7 @@ void ff_slice_buffer_init(slice_buffer *buf, int line_count,
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
buf->data_stack = av_malloc(sizeof(IDWTELEM *) * max_allocated_lines); buf->data_stack = av_malloc(sizeof(IDWTELEM *) * max_allocated_lines);
if (!buf->data_stack) { if (!buf->data_stack) {
av_free(buf->line); av_freep(&buf->line);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
...@@ -47,9 +47,9 @@ void ff_slice_buffer_init(slice_buffer *buf, int line_count, ...@@ -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); buf->data_stack[i] = av_malloc(sizeof(IDWTELEM) * line_width);
if (!buf->data_stack[i]) { if (!buf->data_stack[i]) {
for (i--; i >=0; i--) for (i--; i >=0; i--)
av_free(buf->data_stack[i]); av_freep(&buf->data_stack[i]);
av_free(buf->data_stack); av_freep(&buf->data_stack);
av_free(buf->line); av_freep(&buf->line);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment