mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-10-19 09:53:18 +00:00
fftools/cmdutils: don't try to load arguments from file if not needed
CLI option parser checks if argument exists when needed, but in this case only OPT_TYPE_BOOL where checked, so OPT_TYPE_FUNC without argument where trying to load a file from `arg` which is NULL in this case. Fixes crash on `ffmpeg -/version` Fixes:6d17991b7e
Signed-off-by: Kacper Michajłow <kasper93@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit5f62e2de98
) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
541b670e29
commit
50538d59b1
1 changed files with 3 additions and 2 deletions
|
@ -256,9 +256,10 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
||||||
if (*opt == '/') {
|
if (*opt == '/') {
|
||||||
opt++;
|
opt++;
|
||||||
|
|
||||||
if (po->type == OPT_TYPE_BOOL) {
|
if (!opt_has_arg(po)) {
|
||||||
av_log(NULL, AV_LOG_FATAL,
|
av_log(NULL, AV_LOG_FATAL,
|
||||||
"Requested to load an argument from file for a bool option '%s'\n",
|
"Requested to load an argument from file for an option '%s'"
|
||||||
|
" which does not take an argument\n",
|
||||||
po->name);
|
po->name);
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue