fix crash when used the command like: - ffmpeg -h protocol - ffmpeg -h protocol=
Unified · Split
| @@ -1872,8 +1872,14 @@ static void show_help_demuxer(const char *name) · 1871 unmodified lines | |||
| 1872 | 1872 | ||
| 1873 | static void show_help_protocol(const char *name) | 1873 | static void show_help_protocol(const char *name) |
| 1874 | { | 1874 | { |
| 1875 | const AVClass *proto_class = avio_protocol_get_class(name); | 1875 | const AVClass *proto_class; |
| 1876 | 1876 | ||
| 1877 | if (!name) { | ||
| 1878 | av_log(NULL, AV_LOG_ERROR, "No protocol name specified.\n"); | ||
| 1879 | return; | ||
| 1880 | } | ||
| 1881 | |||
| 1882 | proto_class = avio_protocol_get_class(name); | ||
| 1877 | if (!proto_class) { | 1883 | if (!proto_class) { |
| 1878 | av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name); | 1884 | av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name); |
| 1879 | return; | 1885 | return; |