Commit 0ca33b1d authored by James Almer's avatar James Almer

avformat/utils: free existing extradata before trying to allocate a new one

This prevents leaks in the rare cases the function is called when extradata
already exists.
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent b19e11a4
......@@ -3245,6 +3245,7 @@ int ff_alloc_extradata(AVCodecParameters *par, int size)
{
int ret;
av_freep(&par->extradata);
if (size < 0 || size >= INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
par->extradata = NULL;
par->extradata_size = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment