[FFmpeg-cvslog] doc/examples/transcode_aac: Use avio_closep() in examples as it avoids leaving stale pointers

Michael Niedermayer git at videolan.org
Thu Jan 8 05:29:52 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan  8 05:09:52 2015 +0100| [c61b84ccfda148c325766ee82f26f9231a893420] | committer: Michael Niedermayer

doc/examples/transcode_aac: Use avio_closep() in examples as it avoids leaving stale pointers

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

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

 doc/examples/transcode_aac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c
index e98c217..6998aac 100644
--- a/doc/examples/transcode_aac.c
+++ b/doc/examples/transcode_aac.c
@@ -199,7 +199,7 @@ static int open_output_file(const char *filename,
     return 0;
 
 cleanup:
-    avio_close((*output_format_context)->pb);
+    avio_closep(&(*output_format_context)->pb);
     avformat_free_context(*output_format_context);
     *output_format_context = NULL;
     return error < 0 ? error : AVERROR_EXIT;
@@ -743,7 +743,7 @@ cleanup:
     if (output_codec_context)
         avcodec_close(output_codec_context);
     if (output_format_context) {
-        avio_close(output_format_context->pb);
+        avio_closep(&output_format_context->pb);
         avformat_free_context(output_format_context);
     }
     if (input_codec_context)



More information about the ffmpeg-cvslog mailing list