mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:20:56 +01: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:6d17991b7eSigned-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
ede4c939e3
commit
9a43666d46
1 changed files with 3 additions and 2 deletions
|
|
@ -255,9 +255,10 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
|
|||
if (*opt == '/') {
|
||||
opt++;
|
||||
|
||||
if (po->type == OPT_TYPE_BOOL) {
|
||||
if (!opt_has_arg(po)) {
|
||||
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);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue