Fix segfault in HTTP output when attempting to start a stream without source config

This commit is contained in:
Thulinma 2024-07-22 12:48:48 +02:00
parent e17ae62751
commit ecd7e324dd

View file

@ -576,7 +576,7 @@ bool Util::startInput(std::string streamname, std::string filename, bool forkFir
// Only use configured source if not manually overridden. Abort if no config is available. // Only use configured source if not manually overridden. Abort if no config is available.
if (!filename.size()){ if (!filename.size()){
if (!stream_cfg){ if (!stream_cfg || !stream_cfg.isMember("source") || !stream_cfg["source"].isString() || !stream_cfg["source"]){
MEDIUM_MSG("Stream %s not configured, no source manually given, cannot start", streamname.c_str()); MEDIUM_MSG("Stream %s not configured, no source manually given, cannot start", streamname.c_str());
return false; return false;
} }