aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-13 14:32:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-13 15:24:30 +0200
commitcba9a40d47aefc6853ca6bb8d72096079baac50c (patch)
tree82ddf132fa67035b7f8c85a4d3716cc48305a5b8
parente85771f26814ae192f511a1b01b17ae0d62d62ab (diff)
downloadffmpeg-cba9a40d47aefc6853ca6bb8d72096079baac50c.tar.gz
avcodec: free priv_data in avcodec_copy_context()
Fixes memleak Fixes Ticket2216 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/options.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/options.c b/libavcodec/options.c
index b68c300152..02fb89f5cb 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -190,6 +190,10 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
src, dest);
return AVERROR(EINVAL);
}
+
+ av_opt_free(dest);
+ av_free(dest->priv_data);
+
memcpy(dest, src, sizeof(*dest));
/* set values specific to opened codecs back to their default state */