[FFmpeg-cvslog] avformat/ffmenc: Use av_freep() to avoid leaving stale pointers in memory

Michael Niedermayer git at videolan.org
Wed Feb 18 14:42:18 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 18 14:31:11 2015 +0100| [b68d902b6eec9882213ab860ff8a5f27ba49c7a0] | committer: Michael Niedermayer

avformat/ffmenc: Use av_freep() to avoid 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=b68d902b6eec9882213ab860ff8a5f27ba49c7a0
---

 libavformat/ffmenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
index cacf0d7..10acfbe 100644
--- a/libavformat/ffmenc.c
+++ b/libavformat/ffmenc.c
@@ -137,7 +137,7 @@ static int ffm_write_header_codec_ctx(AVIOContext *pb, AVCodecContext *ctx, unsi
         goto fail;
     if (buf && strlen(buf)) {
         avio_write(tmp, buf, strlen(buf));
-        av_free(buf);
+        av_freep(&buf);
         need_coma = 1;
     }
     if ((ret = av_opt_serialize(ctx, 0, SKIP_DEFAULTS | OPT_FLAGS_EXACT, &buf, '=', ',')) < 0)



More information about the ffmpeg-cvslog mailing list