Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(532)

Unified Diff: webrtc/test/fuzzers/flexfec_header_reader_fuzzer.cc

Issue 2265493002: Fuzzer for FEC header readers. (pt. 6a) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@generalize_fec_header_parsing
Patch Set: Cleaned up a bit. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/test/fuzzers/flexfec_header_reader_fuzzer.cc
diff --git a/webrtc/test/fuzzers/flexfec_header_reader_fuzzer.cc b/webrtc/test/fuzzers/flexfec_header_reader_fuzzer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8ff240f97170680a7c289cc4ad451c2ab3db16dd
--- /dev/null
+++ b/webrtc/test/fuzzers/flexfec_header_reader_fuzzer.cc
@@ -0,0 +1,34 @@
+/*
+ * 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 "webrtc/base/scoped_ref_ptr.h"
+#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
+#include "webrtc/modules/rtp_rtcp/source/flexfec_header_reader_writer.h"
+#include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h"
+
+namespace webrtc {
+
+using Packet = ForwardErrorCorrection::Packet;
+
+void FuzzOneInput(const uint8_t* data, size_t size) {
+ if (size > IP_PACKET_SIZE) {
+ return;
+ }
+
+ ForwardErrorCorrection::ReceivedFecPacket packet;
+ packet.pkt = rtc::scoped_refptr<Packet>(new Packet());
+ memcpy(packet.pkt->data, data, size);
+ packet.pkt->length = size;
+
+ FlexfecHeaderReader flexfec_reader;
+ flexfec_reader.ReadFecHeader(&packet);
+}
+
+} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698