avcodec: free priv_data in avcodec_copy_context()

Fixes memleak
Fixes Ticket2216

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-08-13 14:32:42 +02:00
parent e85771f268
commit cba9a40d47
1 changed files with 4 additions and 0 deletions

View File

@ -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 */