Browse Source

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>
tags/n4.3
Jun Zhao James Almer 5 years ago
parent
commit
b99ed6e428
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      fftools/cmdutils.c

+ 7
- 1
fftools/cmdutils.c View File

@@ -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;


Loading…
Cancel
Save