mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-16 03:50:05 +01:00
avfilter/formats: guard against double free
This commit is contained in:
@@ -456,7 +456,7 @@ do { \
|
||||
do { \
|
||||
int idx = -1; \
|
||||
\
|
||||
if (!*ref || !(*ref)->refs) \
|
||||
if (!ref || !*ref || !(*ref)->refs) \
|
||||
return; \
|
||||
\
|
||||
FIND_REF_INDEX(ref, idx); \
|
||||
@@ -518,7 +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); \
|
||||
if (fmts) \
|
||||
av_freep(&fmts->list); \
|
||||
av_freep(&fmts); \
|
||||
return ret; \
|
||||
} \
|
||||
@@ -530,7 +531,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); \
|
||||
if (fmts) \
|
||||
av_freep(&fmts->list); \
|
||||
av_freep(&fmts); \
|
||||
return ret; \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user