summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/test/fuzzers
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /third_party/libwebrtc/test/fuzzers
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/test/fuzzers')
-rw-r--r--third_party/libwebrtc/test/fuzzers/BUILD.gn1
-rw-r--r--third_party/libwebrtc/test/fuzzers/forward_error_correction_fuzzer.cc6
-rw-r--r--third_party/libwebrtc/test/fuzzers/rtp_frame_reference_finder_fuzzer.cc2
-rw-r--r--third_party/libwebrtc/test/fuzzers/stun_parser_fuzzer.cc3
-rw-r--r--third_party/libwebrtc/test/fuzzers/utils/BUILD.gn4
-rw-r--r--third_party/libwebrtc/test/fuzzers/utils/rtp_replayer.cc11
-rw-r--r--third_party/libwebrtc/test/fuzzers/utils/rtp_replayer.h1
7 files changed, 9 insertions, 19 deletions
diff --git a/third_party/libwebrtc/test/fuzzers/BUILD.gn b/third_party/libwebrtc/test/fuzzers/BUILD.gn
index 3d2ac7a7e7..43e9a5e922 100644
--- a/third_party/libwebrtc/test/fuzzers/BUILD.gn
+++ b/third_party/libwebrtc/test/fuzzers/BUILD.gn
@@ -12,6 +12,7 @@ import("../../webrtc.gni")
rtc_library("webrtc_fuzzer_main") {
sources = [ "webrtc_fuzzer_main.cc" ]
+ testonly = true
deps = [
"../../rtc_base:logging",
"//testing/libfuzzer:fuzzing_engine_main",
diff --git a/third_party/libwebrtc/test/fuzzers/forward_error_correction_fuzzer.cc b/third_party/libwebrtc/test/fuzzers/forward_error_correction_fuzzer.cc
index 04a459bc71..87b76858bb 100644
--- a/third_party/libwebrtc/test/fuzzers/forward_error_correction_fuzzer.cc
+++ b/third_party/libwebrtc/test/fuzzers/forward_error_correction_fuzzer.cc
@@ -34,7 +34,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
ForwardErrorCorrection::CreateFlexfec(kFecSsrc, kMediaSsrc);
// Entropy from fuzzer.
- rtc::ByteBufferReader fuzz_buffer(reinterpret_cast<const char*>(data), size);
+ rtc::ByteBufferReader fuzz_buffer(rtc::MakeArrayView(data, size));
// Initial stream state.
uint16_t media_seqnum;
@@ -75,8 +75,8 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
uint8_t packet_type;
uint8_t packet_loss;
while (true) {
- if (!fuzz_buffer.ReadBytes(reinterpret_cast<char*>(packet_buffer),
- kPacketSize)) {
+ if (!fuzz_buffer.ReadBytes(
+ rtc::ArrayView<uint8_t>(packet_buffer, kPacketSize))) {
return;
}
if (!fuzz_buffer.ReadUInt8(&reordering))
diff --git a/third_party/libwebrtc/test/fuzzers/rtp_frame_reference_finder_fuzzer.cc b/third_party/libwebrtc/test/fuzzers/rtp_frame_reference_finder_fuzzer.cc
index ea66c4a1c8..93673f0b8e 100644
--- a/third_party/libwebrtc/test/fuzzers/rtp_frame_reference_finder_fuzzer.cc
+++ b/third_party/libwebrtc/test/fuzzers/rtp_frame_reference_finder_fuzzer.cc
@@ -23,7 +23,7 @@ class DataReader {
template <typename T>
void CopyTo(T* object) {
- static_assert(std::is_pod<T>(), "");
+ static_assert(std::is_trivial_v<T> && std::is_standard_layout_v<T>, "");
uint8_t* destination = reinterpret_cast<uint8_t*>(object);
size_t object_size = sizeof(T);
size_t num_bytes = std::min(size_ - offset_, object_size);
diff --git a/third_party/libwebrtc/test/fuzzers/stun_parser_fuzzer.cc b/third_party/libwebrtc/test/fuzzers/stun_parser_fuzzer.cc
index 6ca9eac8b2..c8aad8c232 100644
--- a/third_party/libwebrtc/test/fuzzers/stun_parser_fuzzer.cc
+++ b/third_party/libwebrtc/test/fuzzers/stun_parser_fuzzer.cc
@@ -15,14 +15,13 @@
namespace webrtc {
void FuzzOneInput(const uint8_t* data, size_t size) {
- const char* message = reinterpret_cast<const char*>(data);
// Normally we'd check the integrity first, but those checks are
// fuzzed separately in stun_validator_fuzzer.cc. We still want to
// fuzz this target since the integrity checks could be forged by a
// malicious adversary who receives a call.
std::unique_ptr<cricket::IceMessage> stun_msg(new cricket::IceMessage());
- rtc::ByteBufferReader buf(message, size);
+ rtc::ByteBufferReader buf(rtc::MakeArrayView(data, size));
stun_msg->Read(&buf);
stun_msg->ValidateMessageIntegrity("");
}
diff --git a/third_party/libwebrtc/test/fuzzers/utils/BUILD.gn b/third_party/libwebrtc/test/fuzzers/utils/BUILD.gn
index dfb617857c..895e76e939 100644
--- a/third_party/libwebrtc/test/fuzzers/utils/BUILD.gn
+++ b/third_party/libwebrtc/test/fuzzers/utils/BUILD.gn
@@ -15,10 +15,8 @@ rtc_library("rtp_replayer") {
"rtp_replayer.h",
]
deps = [
- "../../../api/rtc_event_log",
- "../../../api/task_queue:default_task_queue_factory",
+ "../../../api/environment:environment_factory",
"../../../api/test/video:function_video_factory",
- "../../../api/transport:field_trial_based_config",
"../../../api/units:timestamp",
"../../../api/video_codecs:video_codecs_api",
"../../../call",
diff --git a/third_party/libwebrtc/test/fuzzers/utils/rtp_replayer.cc b/third_party/libwebrtc/test/fuzzers/utils/rtp_replayer.cc
index f6d7119338..1b1b96803f 100644
--- a/third_party/libwebrtc/test/fuzzers/utils/rtp_replayer.cc
+++ b/third_party/libwebrtc/test/fuzzers/utils/rtp_replayer.cc
@@ -16,8 +16,7 @@
#include <utility>
#include "absl/memory/memory.h"
-#include "api/task_queue/default_task_queue_factory.h"
-#include "api/transport/field_trial_based_config.h"
+#include "api/environment/environment_factory.h"
#include "api/units/timestamp.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
@@ -73,13 +72,7 @@ void RtpReplayer::Replay(
}
// Setup the video streams based on the configuration.
- webrtc::RtcEventLogNull event_log;
- std::unique_ptr<TaskQueueFactory> task_queue_factory =
- CreateDefaultTaskQueueFactory();
- CallConfig call_config(&event_log);
- call_config.task_queue_factory = task_queue_factory.get();
- FieldTrialBasedConfig field_trials;
- call_config.trials = &field_trials;
+ CallConfig call_config(CreateEnvironment());
std::unique_ptr<Call> call(Call::Create(call_config));
SetupVideoStreams(&receive_stream_configs, stream_state.get(), call.get());
diff --git a/third_party/libwebrtc/test/fuzzers/utils/rtp_replayer.h b/third_party/libwebrtc/test/fuzzers/utils/rtp_replayer.h
index ae94a640a5..73220eecfa 100644
--- a/third_party/libwebrtc/test/fuzzers/utils/rtp_replayer.h
+++ b/third_party/libwebrtc/test/fuzzers/utils/rtp_replayer.h
@@ -18,7 +18,6 @@
#include <string>
#include <vector>
-#include "api/rtc_event_log/rtc_event_log.h"
#include "api/test/video/function_video_decoder_factory.h"
#include "api/video_codecs/video_decoder.h"
#include "call/call.h"