swresample: replace 2 av_free() by av_freep()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 16 Sep 2013 20:44:15 +0000 (22:44 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 16 Sep 2013 20:44:15 +0000 (22:44 +0200)
avoids leaving stale pointers in memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/resample.c
libswresample/swresample.c

index fb9da7c..8b1b6ca 100644 (file)
@@ -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;
 }
index cdfe5bf..b9a3c3d 100644 (file)
@@ -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;