2016-10-03 02:02:49 -07: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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
|
2019-01-25 20:26:48 +01:00
|
|
|
#include "api/scoped_refptr.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
|
|
|
|
#include "modules/rtp_rtcp/source/forward_error_correction.h"
|
|
|
|
|
#include "modules/rtp_rtcp/source/ulpfec_header_reader_writer.h"
|
2016-10-03 02:02:49 -07:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
using Packet = ForwardErrorCorrection::Packet;
|
2016-10-05 07:34:53 -07:00
|
|
|
using ReceivedFecPacket = ForwardErrorCorrection::ReceivedFecPacket;
|
2016-10-03 02:02:49 -07:00
|
|
|
|
|
|
|
|
void FuzzOneInput(const uint8_t* data, size_t size) {
|
2016-10-05 07:34:53 -07:00
|
|
|
ReceivedFecPacket packet;
|
2016-10-03 02:02:49 -07:00
|
|
|
packet.pkt = rtc::scoped_refptr<Packet>(new Packet());
|
|
|
|
|
const size_t packet_size =
|
|
|
|
|
std::min(size, static_cast<size_t>(IP_PACKET_SIZE));
|
2019-09-03 07:52:52 +00:00
|
|
|
memcpy(packet.pkt->data, data, packet_size);
|
|
|
|
|
packet.pkt->length = packet_size;
|
2016-10-03 02:02:49 -07:00
|
|
|
|
|
|
|
|
UlpfecHeaderReader ulpfec_reader;
|
|
|
|
|
ulpfec_reader.ReadFecHeader(&packet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|