mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
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:
parent
e85771f268
commit
cba9a40d47
@ -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 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user