mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
avfilter/formats: fix leak of formats on error
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
369b161d8e
commit
9f17d4ae7e
@ -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++; \
|
||||
|
Loading…
Reference in New Issue
Block a user