Skip to content
Snippets Groups Projects
Commit cba9a40d authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec: free priv_data in avcodec_copy_context()


Fixes memleak
Fixes Ticket2216

Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent e85771f2
No related branches found
No related tags found
No related merge requests found
...@@ -190,6 +190,10 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src) ...@@ -190,6 +190,10 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
src, dest); src, dest);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
av_opt_free(dest);
av_free(dest->priv_data);
memcpy(dest, src, sizeof(*dest)); memcpy(dest, src, sizeof(*dest));
/* set values specific to opened codecs back to their default state */ /* set values specific to opened codecs back to their default state */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment