blob: 7b52ee0fc322d6030a6a68262fcdc266f70edd4d [file] [log] [blame]
philipelea142f82017-01-11 02:01:56 -08001/*
2 * Copyright (c) 2017 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 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "modules/video_coding/packet_buffer.h"
12#include "system_wrappers/include/clock.h"
philipel0c87e292018-05-17 16:44:47 +020013#include "test/fuzzers/fuzz_data_helper.h"
philipelea142f82017-01-11 02:01:56 -080014
15namespace webrtc {
philipelea142f82017-01-11 02:01:56 -080016namespace {
17class NullCallback : public video_coding::OnReceivedFrameCallback {
18 void OnReceivedFrame(std::unique_ptr<video_coding::RtpFrameObject> frame) {}
19};
20} // namespace
21
22void FuzzOneInput(const uint8_t* data, size_t size) {
philipelea142f82017-01-11 02:01:56 -080023 VCMPacket packet;
24 NullCallback callback;
25 SimulatedClock clock(0);
26 rtc::scoped_refptr<video_coding::PacketBuffer> packet_buffer(
27 video_coding::PacketBuffer::Create(&clock, 8, 1024, &callback));
philipel0c87e292018-05-17 16:44:47 +020028 test::FuzzDataHelper helper(rtc::ArrayView<const uint8_t>(data, size));
philipelea142f82017-01-11 02:01:56 -080029
philipel0c87e292018-05-17 16:44:47 +020030 while (helper.BytesLeft())
31 helper.CopyTo(&packet);
philipelea142f82017-01-11 02:01:56 -080032}
33
34} // namespace webrtc