Commit b99ed6e4 authored by Jun Zhao's avatar Jun Zhao Committed by James Almer

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: 's avatarJun Zhao <barryjzhao@tencent.com>
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 863accbe
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment