diff --git a/components/streams/src/stream.cpp b/components/streams/src/stream.cpp index 8861d0a794a4016f34079e6f475ec9e22a87bbc5..72a8524e97d538ad1f407bcad15ebf76cf3b2517 100644 --- a/components/streams/src/stream.cpp +++ b/components/streams/src/stream.cpp @@ -45,12 +45,16 @@ const std::unordered_set<ftl::codecs::Channel> &Stream::selected(int fs) const { } std::unordered_set<ftl::codecs::Channel> Stream::selectedNoExcept(int fs) const { + if (fs == 255) return {}; + SHARED_LOCK(mtx_, lk); if (fs < 0 || static_cast<uint32_t>(fs) >= state_.size()) return {}; return state_[fs].selected; } void Stream::select(int fs, const std::unordered_set<ftl::codecs::Channel> &s, bool make) { + if (fs == 255) return; + UNIQUE_LOCK(mtx_, lk); if (fs < 0 || (!make && static_cast<uint32_t>(fs) >= state_.size())) throw FTL_Error("Frameset index out-of-bounds: " << fs); if (static_cast<uint32_t>(fs) >= state_.size()) state_.resize(fs+1);