blob: 7f8cabafd68ea48beb9a4b87e9570cc4e303def3 [file] [log] [blame]
Peter Boströmba3e25e2016-02-23 11:35:30 +01001/*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
Jonathan Metzman9f80b972018-10-05 10:38:13 -070010#include "modules/rtp_rtcp/source/rtcp_packet/tmmb_item.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "modules/rtp_rtcp/source/rtcp_receiver.h"
12#include "rtc_base/checks.h"
13#include "system_wrappers/include/clock.h"
Peter Boströmba3e25e2016-02-23 11:35:30 +010014
15namespace webrtc {
Danil Chapovalov97088842016-09-13 12:41:41 +020016namespace {
17
Jiawei Ou8b5d9d82018-11-15 16:44:37 -080018constexpr int kRtcpIntervalMs = 1000;
19
Danil Chapovalov97088842016-09-13 12:41:41 +020020class NullModuleRtpRtcp : public RTCPReceiver::ModuleRtpRtcp {
21 public:
22 void SetTmmbn(std::vector<rtcp::TmmbItem>) override {}
23 void OnRequestSendReport() override {}
Yves Gerey665174f2018-06-19 15:03:05 +020024 void OnReceivedNack(const std::vector<uint16_t>&) override{};
25 void OnReceivedRtcpReportBlocks(const ReportBlockList&) override{};
Danil Chapovalov97088842016-09-13 12:41:41 +020026};
27
Yves Gerey665174f2018-06-19 15:03:05 +020028} // namespace
Peter Boströmba3e25e2016-02-23 11:35:30 +010029
30void FuzzOneInput(const uint8_t* data, size_t size) {
Danil Chapovalov97088842016-09-13 12:41:41 +020031 NullModuleRtpRtcp rtp_rtcp_module;
32 SimulatedClock clock(1234);
Peter Boströmba3e25e2016-02-23 11:35:30 +010033
Peter Boströmba3e25e2016-02-23 11:35:30 +010034 RTCPReceiver receiver(&clock, false, nullptr, nullptr, nullptr, nullptr,
Jiawei Ou8b5d9d82018-11-15 16:44:37 -080035 nullptr, kRtcpIntervalMs, &rtp_rtcp_module);
Peter Boströmba3e25e2016-02-23 11:35:30 +010036
Danil Chapovalov97088842016-09-13 12:41:41 +020037 receiver.IncomingPacket(data, size);
Peter Boströmba3e25e2016-02-23 11:35:30 +010038}
39} // namespace webrtc