tcp情况下,rtp长度不得超过2K,防止发送端存在缓存覆盖的bug

This commit is contained in:
xiongziliang 2020-10-18 23:05:24 +08:00
parent ac381350f3
commit b7d6442870
1 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,9 @@ void RtpSession::onManager() {
}
void RtpSession::onRtpPacket(const char *data, uint64_t len) {
if (len > 1024 * 2) {
throw SockException(Err_shutdown, "rtp包长度异常发送端可能缓存溢出并覆盖");
}
if (!_process) {
uint32_t ssrc;
if (!RtpSelector::getSSRC(data, len, ssrc)) {