Commit 1c302b60 authored by James Almer's avatar James Almer

avcodec/options: do a more thorough clean up in avcodec_copy_context()

Free coded_frame to prevent potential leaks.
Reviewed-by: 's avatarAaron Levinson <alevinsn@aracnet.com>
Tested-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
(cherry picked from commit cac8de2d)
parent 4122e5fc
...@@ -182,6 +182,11 @@ void avcodec_free_context(AVCodecContext **pavctx) ...@@ -182,6 +182,11 @@ void avcodec_free_context(AVCodecContext **pavctx)
static void copy_context_reset(AVCodecContext *avctx) static void copy_context_reset(AVCodecContext *avctx)
{ {
av_opt_free(avctx); av_opt_free(avctx);
#if FF_API_CODED_FRAME
FF_DISABLE_DEPRECATION_WARNINGS
av_frame_free(&avctx->coded_frame);
FF_ENABLE_DEPRECATION_WARNINGS
#endif
av_freep(&avctx->rc_override); av_freep(&avctx->rc_override);
av_freep(&avctx->intra_matrix); av_freep(&avctx->intra_matrix);
av_freep(&avctx->inter_matrix); av_freep(&avctx->inter_matrix);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment