[FFmpeg-cvslog] dwt: use av_freep()

Michael Niedermayer git at videolan.org
Wed May 23 12:27:50 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue May 22 23:58:46 2012 +0200| [60c950ac0859f93956eeab597b7cff95600fae6a] | committer: Michael Niedermayer

dwt: use av_freep()

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

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

 libavcodec/dwt.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/dwt.c b/libavcodec/dwt.c
index 100aef5..748bd40 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);
         }
     }



More information about the ffmpeg-cvslog mailing list