@@ -1854,8 +1854,14 @@ static void show_help_codec(const char *name, int encoder)
static void show_help_demuxer(const char *name)
{
- const AVInputFormat *fmt = av_find_input_format(name);
+ const AVInputFormat *fmt = NULL;
+ if (!name) {
+ av_log(NULL, AV_LOG_ERROR, "No demuxer name specified.\n");
+ return;
+ }
+
+ fmt = av_find_input_format(name);
if (!fmt) {
av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name);
return;
@@ -1891,8 +1897,13 @@ static void show_help_protocol(const char *name)
static void show_help_muxer(const char *name)
{
const AVCodecDescriptor *desc;
- const AVOutputFormat *fmt = av_guess_format(name, NULL, NULL);
+ const AVOutputFormat *fmt = NULL;
+ if (!name) {
+ av_log(NULL, AV_LOG_ERROR, "No muxer name specified.\n");
+ return;
+ }
+ fmt = av_guess_format(name, NULL, NULL);
if (!fmt) {
av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name);
return;
Signed-off-by: Steven Liu <lq@chinaffmpeg.org> --- fftools/cmdutils.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)