Commit 9f17d4ae authored by Paul B Mahol's avatar Paul B Mahol

avfilter/formats: fix leak of formats on error

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 369b161d
......@@ -518,6 +518,8 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref)
int ret = ref_fn(fmts, &ctx->inputs[i]->out_fmts); \
if (ret < 0) { \
unref_fn(&fmts); \
av_freep(&fmts->list); \
av_freep(&fmts); \
return ret; \
} \
count++; \
......@@ -528,6 +530,8 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref)
int ret = ref_fn(fmts, &ctx->outputs[i]->in_fmts); \
if (ret < 0) { \
unref_fn(&fmts); \
av_freep(&fmts->list); \
av_freep(&fmts); \
return ret; \
} \
count++; \
......
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