Log an error in RtpDemuxer::FindSsrcAssociations() if kMaxProcessedSsrcs exceeded
BUG=None Review-Url: https://codereview.webrtc.org/2941513002 Cr-Commit-Position: refs/heads/master@{#18569}
This commit is contained in:
parent
7ed35f4643
commit
dea075c7a6
@ -8,8 +8,10 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/call/rtp_demuxer.h"
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/call/rtp_packet_sink_interface.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h"
|
||||
@ -118,6 +120,10 @@ void RtpDemuxer::FindSsrcAssociations(const RtpPacketReceived& packet) {
|
||||
|
||||
if (processed_ssrcs_.size() < kMaxProcessedSsrcs) { // Prevent memory overuse
|
||||
processed_ssrcs_.insert(packet.Ssrc()); // Avoid re-examining in-depth.
|
||||
} else if (!logged_max_processed_ssrcs_exceeded_) {
|
||||
LOG(LS_WARNING) << "More than " << kMaxProcessedSsrcs
|
||||
<< " different SSRCs seen.";
|
||||
logged_max_processed_ssrcs_exceeded_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -70,6 +70,9 @@ class RtpDemuxer {
|
||||
// check RSIDs for the first packet on each incoming SSRC stream.
|
||||
// (If RSID associations are added later, we check again.)
|
||||
std::set<uint32_t> processed_ssrcs_;
|
||||
|
||||
// Avoid an attack that would create excessive logging.
|
||||
bool logged_max_processed_ssrcs_exceeded_ = false;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user