[FFmpeg-cvslog] avcodec/snow_dwt: use av_malloc(z)_array()

Michael Niedermayer git at videolan.org
Wed Apr 23 16:41:24 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Apr 23 15:51:21 2014 +0200| [c161134035a08f7454c68fa12c882917015bf65f] | committer: Michael Niedermayer

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

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c161134035a08f7454c68fa12c882917015bf65f
---

 libavcodec/snow_dwt.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/snow_dwt.c b/libavcodec/snow_dwt.c
index 28edf6a..ed8284c 100644
--- a/libavcodec/snow_dwt.c
+++ b/libavcodec/snow_dwt.c
@@ -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]);



More information about the ffmpeg-cvslog mailing list