[FFmpeg-cvslog] avcodec/options: do a more thorough clean up in avcodec_copy_context()

James Almer git at videolan.org
Sat May 20 06:01:52 EEST 2017


ffmpeg | branch: release/2.8 | James Almer <jamrial at gmail.com> | Mon Apr 24 14:53:47 2017 -0300| [1c302b606e0fd86dd0ac1ff66e56a1f7d321d7e1] | committer: James Almer

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

Free coded_frame to prevent potential leaks.

Reviewed-by: Aaron Levinson <alevinsn at aracnet.com>
Tested-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit cac8de2da5c4935773128335c11b806faa73e19d)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1c302b606e0fd86dd0ac1ff66e56a1f7d321d7e1
---

 libavcodec/options.c | 5 +++++
 1 file changed, 5 insertions(+)

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



More information about the ffmpeg-cvslog mailing list