summaryrefslogtreecommitdiff
path: root/fftools
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2020-01-30 22:03:17 +0800
committerJames Almer <jamrial@gmail.com>2020-01-30 12:50:22 -0300
commitb99ed6e4287ccc4dcaf3c5133e9ec62d4ddb5bc6 (patch)
tree1444868ec14e92e7f4fac13558fa3dbde7dd85a6 /fftools
parent863accbefa2b433adbdfe189438adb11abc276c6 (diff)
cmdutils: fix crash if no name for "ffmpeg -h protocol"
fix crash when used the command like: - ffmpeg -h protocol - ffmpeg -h protocol= Signed-off-by: Jun Zhao <barryjzhao@tencent.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'fftools')
-rw-r--r--fftools/cmdutils.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 22846317c1..f0f2b4fde4 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1872,8 +1872,14 @@ static void show_help_demuxer(const char *name)
static void show_help_protocol(const char *name)
{
- const AVClass *proto_class = avio_protocol_get_class(name);
+ const AVClass *proto_class;
+ if (!name) {
+ av_log(NULL, AV_LOG_ERROR, "No protocol name specified.\n");
+ return;
+ }
+
+ proto_class = avio_protocol_get_class(name);
if (!proto_class) {
av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name);
return;