[FFmpeg-cvslog] doc/examples/resampling_audio: use av_freep() for saftey

Michael Niedermayer git at videolan.org
Sun Jun 29 16:31:51 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 29 15:50:29 2014 +0200| [cddbf95c5f0dea1bb1a18271393ad2a020883fe4] | committer: Michael Niedermayer

doc/examples/resampling_audio: use av_freep() for saftey

also its better in examples to use the safer functions.

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

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

 doc/examples/resampling_audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/examples/resampling_audio.c b/doc/examples/resampling_audio.c
index f743cbe..8a43b09 100644
--- a/doc/examples/resampling_audio.c
+++ b/doc/examples/resampling_audio.c
@@ -168,7 +168,7 @@ int main(int argc, char **argv)
         dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, src_rate) +
                                         src_nb_samples, dst_rate, src_rate, AV_ROUND_UP);
         if (dst_nb_samples > max_dst_nb_samples) {
-            av_free(dst_data[0]);
+            av_freep(&dst_data[0]);
             ret = av_samples_alloc(dst_data, &dst_linesize, dst_nb_channels,
                                    dst_nb_samples, dst_sample_fmt, 1);
             if (ret < 0)



More information about the ffmpeg-cvslog mailing list