fixes a memleak for Vorbis and Theora, where the comment header from
avpriv_split_xiph_headers() is replaced by a buffer that must be freed
separately.
---
 libavformat/oggenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 33aba87..bffacfd 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -497,8 +497,8 @@ static int ogg_write_trailer(AVFormatContext *s)
         if (st->codec->codec_id == CODEC_ID_FLAC ||
             st->codec->codec_id == CODEC_ID_SPEEX) {
             av_free(oggstream->header[0]);
-            av_free(oggstream->header[1]);
         }
+        av_freep(&oggstream->header[1]);
         av_freep(&st->priv_data);
     }
     return 0;
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to