Fix fuzzer build failures on Windows
Fix the following issues with fuzz targets when built on Windows:
1. Fix audio_processing_fuzzer by making types match in
invocations of CheckedDivExact by explicitly casting to size_t.
2. Fix packet_buffer_fuzzer by including "frame_object.h" for
declaration of RtpFrameObject.
3. Fix rtcp_receiver_fuzzer by including "tmmb_item.h" for declaration
of TmmbItem.
Bug: chromium:891867
Change-Id: Iddc338360ca37d5fc31488ec908eb4cdb5cc7b94
Reviewed-on: https://webrtc-review.googlesource.com/c/103844
Commit-Queue: Jonathan Metzman <metzman@chromium.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25028}
diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn
index aafe2d9..ccc15a6 100644
--- a/test/fuzzers/BUILD.gn
+++ b/test/fuzzers/BUILD.gn
@@ -218,6 +218,7 @@
]
deps = [
"../../modules/rtp_rtcp",
+ "../../modules/rtp_rtcp:rtp_rtcp_format",
"../../rtc_base:checks",
"../../rtc_base:rtc_base_approved",
"../../system_wrappers:system_wrappers",
diff --git a/test/fuzzers/audio_processing_fuzzer_helper.cc b/test/fuzzers/audio_processing_fuzzer_helper.cc
index 9989111..073ab17 100644
--- a/test/fuzzers/audio_processing_fuzzer_helper.cc
+++ b/test/fuzzers/audio_processing_fuzzer_helper.cc
@@ -30,7 +30,7 @@
size_t num_channels,
float* const* float_frames) {
const size_t samples_per_input_channel =
- rtc::CheckedDivExact(input_rate, 100ul);
+ rtc::CheckedDivExact(input_rate, static_cast<size_t>(100));
RTC_DCHECK_LE(samples_per_input_channel, 480);
for (size_t i = 0; i < num_channels; ++i) {
std::fill(float_frames[i], float_frames[i] + samples_per_input_channel, 0);
@@ -55,7 +55,7 @@
size_t num_channels,
AudioFrame* fixed_frame) {
const size_t samples_per_input_channel =
- rtc::CheckedDivExact(input_rate, 100ul);
+ rtc::CheckedDivExact(input_rate, static_cast<size_t>(100));
fixed_frame->samples_per_channel_ = samples_per_input_channel;
fixed_frame->sample_rate_hz_ = input_rate;
fixed_frame->num_channels_ = num_channels;
diff --git a/test/fuzzers/packet_buffer_fuzzer.cc b/test/fuzzers/packet_buffer_fuzzer.cc
index 8ad21e1..d226764 100644
--- a/test/fuzzers/packet_buffer_fuzzer.cc
+++ b/test/fuzzers/packet_buffer_fuzzer.cc
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "modules/video_coding/frame_object.h"
#include "modules/video_coding/packet_buffer.h"
#include "system_wrappers/include/clock.h"
#include "test/fuzzers/fuzz_data_helper.h"
diff --git a/test/fuzzers/rtcp_receiver_fuzzer.cc b/test/fuzzers/rtcp_receiver_fuzzer.cc
index d87e002..cd763d0 100644
--- a/test/fuzzers/rtcp_receiver_fuzzer.cc
+++ b/test/fuzzers/rtcp_receiver_fuzzer.cc
@@ -7,6 +7,7 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "modules/rtp_rtcp/source/rtcp_packet/tmmb_item.h"
#include "modules/rtp_rtcp/source/rtcp_receiver.h"
#include "rtc_base/checks.h"
#include "system_wrappers/include/clock.h"