[FFmpeg-cvslog] lavc/options: fix shallow copy context

Lukasz Marek git at videolan.org
Sun Nov 9 17:57:37 CET 2014


ffmpeg | branch: master | Lukasz Marek <lukasz.m.luki2 at gmail.com> | Sat Nov  8 17:01:40 2014 +0100| [db2caf0a80d25696a1b0a1308e79a2a128ec36f9] | committer: Lukasz Marek

lavc/options: fix shallow copy context

avcodec_copy_context leaves shallow copy of string/binary/dict options.
Double free/accessing freed memory may occur.

Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>

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

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

diff --git a/libavcodec/options.c b/libavcodec/options.c
index c4ee234..461e4a1 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -187,6 +187,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
     av_opt_free(dest);
 
     memcpy(dest, src, sizeof(*dest));
+    av_opt_copy(dest, src);
 
     dest->priv_data       = orig_priv_data;
 



More information about the ffmpeg-cvslog mailing list