Merge pull request #82 from capitalistspz/is-open-stream-fix

Correct check in `isOpenStream`
This commit is contained in:
Jason von Nieda 2025-06-13 13:17:43 -05:00 committed by GitHub
commit c0e5f80c1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -198,9 +198,9 @@ uint32_t Context::isOpenStream(int32_t streamID)
return 0;
}
if (static_cast<uint32_t>(streamID) >= m_streams.size())
if (m_streams.find(streamID) == m_streams.cend())
{
LOG(LOG_ERR, "isOpenStream was called with an out-of-bounds stream ID\n");
LOG(LOG_ERR, "isOpenStream was called with an invalid stream ID\n");
return 0;
}