Commit c1611340 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/snow_dwt: use av_malloc(z)_array()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f21c263c
......@@ -35,17 +35,17 @@ int ff_slice_buffer_init(slice_buffer *buf, int line_count,
buf->line_count = line_count;
buf->line_width = line_width;
buf->data_count = max_allocated_lines;
buf->line = av_mallocz(sizeof(IDWTELEM *) * line_count);
buf->line = av_mallocz_array(line_count, sizeof(IDWTELEM *));
if (!buf->line)
return AVERROR(ENOMEM);
buf->data_stack = av_malloc(sizeof(IDWTELEM *) * max_allocated_lines);
buf->data_stack = av_malloc_array(max_allocated_lines, sizeof(IDWTELEM *));
if (!buf->data_stack) {
av_freep(&buf->line);
return AVERROR(ENOMEM);
}
for (i = 0; i < max_allocated_lines; i++) {
buf->data_stack[i] = av_malloc(sizeof(IDWTELEM) * line_width);
buf->data_stack[i] = av_malloc_array(line_width, sizeof(IDWTELEM));
if (!buf->data_stack[i]) {
for (i--; i >=0; i--)
av_freep(&buf->data_stack[i]);
......
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