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:
@ -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);
|
||||
|
Reference in New Issue
Block a user