Message ID | 20200518185508.44779-1-artem.galin@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [FFmpeg-devel,v5,1/9] fftools/qsv: add device initialization from string | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
<artem.galin@gmail.com> 于2020年5月19日周二 上午3:26写道: > > From: Artem Galin <artem.galin@intel.com> > > Signed-off-by: Artem Galin <artem.galin@intel.com> > --- > fftools/ffmpeg_opt.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c > index 60bb437ea7..83f1b53e9d 100644 > --- a/fftools/ffmpeg_opt.c > +++ b/fftools/ffmpeg_opt.c > @@ -558,7 +558,11 @@ static int opt_init_hw_device(void *optctx, const char *opt, const char *arg) > printf("\n"); > exit_program(0); > } else { > - return hw_device_init_from_string(arg, NULL); > + int err; > + if (!arg) > + return AVERROR(ENOMEM); There is no memory allocation, so return EINVAL is better IMHO. > + err = hw_device_init_from_string(arg, NULL); > + return err; > } > } The rest look good, but prefer to remove "qsv" in the patch subject since this is not a "qsv" limited change .
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 60bb437ea7..83f1b53e9d 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -558,7 +558,11 @@ static int opt_init_hw_device(void *optctx, const char *opt, const char *arg) printf("\n"); exit_program(0); } else { - return hw_device_init_from_string(arg, NULL); + int err; + if (!arg) + return AVERROR(ENOMEM); + err = hw_device_init_from_string(arg, NULL); + return err; } }