2016-02-23 11:35:30 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
2018-10-05 10:38:13 -07:00
|
|
|
#include "modules/rtp_rtcp/source/rtcp_packet/tmmb_item.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/rtp_rtcp/source/rtcp_receiver.h"
|
2020-06-03 22:55:33 +02:00
|
|
|
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/checks.h"
|
|
|
|
|
#include "system_wrappers/include/clock.h"
|
2016-02-23 11:35:30 +01:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2016-09-13 12:41:41 +02:00
|
|
|
namespace {
|
|
|
|
|
|
2018-11-15 16:44:37 -08:00
|
|
|
constexpr int kRtcpIntervalMs = 1000;
|
|
|
|
|
|
2019-04-07 23:50:08 +02:00
|
|
|
// RTCP is typically sent over UDP, which has a maximum payload length
|
|
|
|
|
// of 65535 bytes. We err on the side of caution and check a bit above that.
|
|
|
|
|
constexpr size_t kMaxInputLenBytes = 66000;
|
|
|
|
|
|
2016-09-13 12:41:41 +02:00
|
|
|
class NullModuleRtpRtcp : public RTCPReceiver::ModuleRtpRtcp {
|
|
|
|
|
public:
|
|
|
|
|
void SetTmmbn(std::vector<rtcp::TmmbItem>) override {}
|
|
|
|
|
void OnRequestSendReport() override {}
|
2019-02-25 11:39:52 -05:00
|
|
|
void OnReceivedNack(const std::vector<uint16_t>&) override {}
|
|
|
|
|
void OnReceivedRtcpReportBlocks(const ReportBlockList&) override {}
|
2016-09-13 12:41:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace
|
2016-02-23 11:35:30 +01:00
|
|
|
|
|
|
|
|
void FuzzOneInput(const uint8_t* data, size_t size) {
|
2019-04-07 23:50:08 +02:00
|
|
|
if (size > kMaxInputLenBytes) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-13 12:41:41 +02:00
|
|
|
NullModuleRtpRtcp rtp_rtcp_module;
|
|
|
|
|
SimulatedClock clock(1234);
|
2016-02-23 11:35:30 +01:00
|
|
|
|
2020-06-03 22:55:33 +02:00
|
|
|
RtpRtcpInterface::Configuration config;
|
2019-07-12 17:35:05 +00:00
|
|
|
config.clock = &clock;
|
|
|
|
|
config.rtcp_report_interval_ms = kRtcpIntervalMs;
|
2019-10-18 10:34:25 +02:00
|
|
|
config.local_media_ssrc = 1;
|
2019-07-12 17:35:05 +00:00
|
|
|
|
|
|
|
|
RTCPReceiver receiver(config, &rtp_rtcp_module);
|
2016-02-23 11:35:30 +01:00
|
|
|
|
2016-09-13 12:41:41 +02:00
|
|
|
receiver.IncomingPacket(data, size);
|
2016-02-23 11:35:30 +01:00
|
|
|
}
|
|
|
|
|
} // namespace webrtc
|