aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-04-24 14:53:47 -0300
committerJames Almer <jamrial@gmail.com>2017-05-19 23:37:03 -0300
commit1c302b606e0fd86dd0ac1ff66e56a1f7d321d7e1 (patch)
tree477c99a8a9744a61dadbd893797981a6c50f8d2f
parent4122e5fcb3b2fb5911b5ac24b975102b53fbde91 (diff)
downloadffmpeg-1c302b606e0fd86dd0ac1ff66e56a1f7d321d7e1.tar.gz
avcodec/options: do a more thorough clean up in avcodec_copy_context()
Free coded_frame to prevent potential leaks. Reviewed-by: Aaron Levinson <alevinsn@aracnet.com> Tested-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit cac8de2da5c4935773128335c11b806faa73e19d)
-rw-r--r--libavcodec/options.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 35098b864d..dfd1100d5d 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -182,6 +182,11 @@ void avcodec_free_context(AVCodecContext **pavctx)
static void copy_context_reset(AVCodecContext *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->intra_matrix);
av_freep(&avctx->inter_matrix);