fftools/ffmpeg_mux_init: Cleanup on error return in set_dispositions()
Fixes: CID1539099 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -865,7 +865,7 @@ void update_benchmark(const char *fmt, ...);
|
|||||||
namestr, st->index, o->optname.opt_canon->name, spec[0] ? ":" : "", spec, so->u.type);\
|
namestr, st->index, o->optname.opt_canon->name, spec[0] ? ":" : "", spec, so->u.type);\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
|
#define MATCH_PER_STREAM_OPT_CLEAN(name, type, outvar, fmtctx, st, clean)\
|
||||||
{\
|
{\
|
||||||
int _ret, _matches = 0, _match_idx;\
|
int _ret, _matches = 0, _match_idx;\
|
||||||
for (int _i = 0; _i < o->name.nb_opt; _i++) {\
|
for (int _i = 0; _i < o->name.nb_opt; _i++) {\
|
||||||
@@ -875,12 +875,17 @@ void update_benchmark(const char *fmt, ...);
|
|||||||
_match_idx = _i;\
|
_match_idx = _i;\
|
||||||
_matches++;\
|
_matches++;\
|
||||||
} else if (_ret < 0)\
|
} else if (_ret < 0)\
|
||||||
return _ret;\
|
clean;\
|
||||||
}\
|
}\
|
||||||
if (_matches > 1 && o->name.opt_canon)\
|
if (_matches > 1 && o->name.opt_canon)\
|
||||||
WARN_MULTIPLE_OPT_USAGE(name, type, _match_idx, st);\
|
WARN_MULTIPLE_OPT_USAGE(name, type, _match_idx, st);\
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
|
||||||
|
{\
|
||||||
|
MATCH_PER_STREAM_OPT_CLEAN(name, type, outvar, fmtctx, st, return _ret)\
|
||||||
|
}
|
||||||
|
|
||||||
const char *opt_match_per_type_str(const SpecifierOptList *sol,
|
const char *opt_match_per_type_str(const SpecifierOptList *sol,
|
||||||
char mediatype);
|
char mediatype);
|
||||||
|
|
||||||
|
|||||||
@@ -2933,7 +2933,7 @@ static int set_dispositions(Muxer *mux, const OptionsContext *o)
|
|||||||
|
|
||||||
nb_streams[ost->type + 1]++;
|
nb_streams[ost->type + 1]++;
|
||||||
|
|
||||||
MATCH_PER_STREAM_OPT(disposition, str, dispositions[i], ctx, ost->st);
|
MATCH_PER_STREAM_OPT_CLEAN(disposition, str, dispositions[i], ctx, ost->st, goto finish);
|
||||||
|
|
||||||
have_manual |= !!dispositions[i];
|
have_manual |= !!dispositions[i];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user