lavf,lavc: free avoptions in a generic way.

It's simpler and less error-prone.

Fixes some memleaks along the way.
This commit is contained in:
Anton Khirnov
2011-06-05 13:18:17 +02:00
parent b39b06233d
commit 367732832f
10 changed files with 9 additions and 21 deletions

View File

@ -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);