]> git.sesse.net Git - nageru/blobdiff - mux.cpp
Fix a file descriptor leak.
[nageru] / mux.cpp
diff --git a/mux.cpp b/mux.cpp
index 8dd969a3ec8a95b4a21d21a4e7eae906ce584f6d..2947cac82ab519bdddb22e9bab1862805f80658e 100644 (file)
--- a/mux.cpp
+++ b/mux.cpp
@@ -94,8 +94,7 @@ Mux::Mux(AVFormatContext *avctx, int width, int height, Codec video_codec, const
 Mux::~Mux()
 {
        av_write_trailer(avctx);
-       av_free(avctx->pb->buffer);
-       av_free(avctx->pb);
+       avio_closep(&avctx->pb);
        avformat_free_context(avctx);
 }