1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avfilter/formats: fix leak of formats on error

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol
2016-01-02 21:05:40 +01:00
parent 369b161d8e
commit 9f17d4ae7e

View File

@@ -518,6 +518,8 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref)
int ret = ref_fn(fmts, &ctx->inputs[i]->out_fmts); \ int ret = ref_fn(fmts, &ctx->inputs[i]->out_fmts); \
if (ret < 0) { \ if (ret < 0) { \
unref_fn(&fmts); \ unref_fn(&fmts); \
av_freep(&fmts->list); \
av_freep(&fmts); \
return ret; \ return ret; \
} \ } \
count++; \ count++; \
@@ -528,6 +530,8 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref)
int ret = ref_fn(fmts, &ctx->outputs[i]->in_fmts); \ int ret = ref_fn(fmts, &ctx->outputs[i]->in_fmts); \
if (ret < 0) { \ if (ret < 0) { \
unref_fn(&fmts); \ unref_fn(&fmts); \
av_freep(&fmts->list); \
av_freep(&fmts); \
return ret; \ return ret; \
} \ } \
count++; \ count++; \