[FFmpeg-cvslog] swresample: replace 2 av_free() by av_freep()

Michael Niedermayer git at videolan.org
Mon Sep 16 23:03:41 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Sep 16 22:44:15 2013 +0200| [9078b40d354b1e3e8995ca781d4ccfda0044a8f4] | committer: Michael Niedermayer

swresample: replace 2 av_free() by av_freep()

avoids leaving stale pointers in memory

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

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

 libswresample/resample.c   |    2 +-
 libswresample/swresample.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index fb9da7c..8b1b6ca 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -256,7 +256,7 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r
 
     return c;
 error:
-    av_free(c->filter_bank);
+    av_freep(&c->filter_bank);
     av_free(c);
     return NULL;
 }
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index cdfe5bf..b9a3c3d 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -468,7 +468,7 @@ int swri_realloc_audio(AudioData *a, int count){
         if(a->planar) memcpy(a->ch[i], old.ch[i], a->count*a->bps);
     }
     if(!a->planar) memcpy(a->ch[0], old.ch[0], a->count*a->ch_count*a->bps);
-    av_free(old.data);
+    av_freep(&old.data);
     a->count= count;
 
     return 1;



More information about the ffmpeg-cvslog mailing list