diff mbox series

[FFmpeg-devel] fftools/cmdutils: add no demuxer/muxer name specified message

Message ID 20200131233704.38591-1-lq@chinaffmpeg.org
State New
Headers show
Series [FFmpeg-devel] fftools/cmdutils: add no demuxer/muxer name specified message
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Steven Liu Jan. 31, 2020, 11:37 p.m. UTC
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 fftools/cmdutils.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index f0f2b4fde4..6e387ccb10 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -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;