From 367732832faaf1bac4ece37cf7fef8c911e16312 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 5 Jun 2011 13:18:17 +0200 Subject: lavf,lavc: free avoptions in a generic way. It's simpler and less error-prone. Fixes some memleaks along the way. --- libavcodec/utils.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavcodec/utils.c') diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 65792a6f5a..2b417defbf 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -783,6 +783,9 @@ av_cold int avcodec_close(AVCodecContext *avctx) avctx->codec->close(avctx); avcodec_default_free_buffers(avctx); avctx->coded_frame = NULL; + if (avctx->codec->priv_class) + av_opt_free(avctx->priv_data); + av_opt_free(avctx); av_freep(&avctx->priv_data); if(avctx->codec && avctx->codec->encode) av_freep(&avctx->extradata); -- cgit v1.2.3