From 9f80b97309dffa42780dd1f0e8eab79ff4db490d Mon Sep 17 00:00:00 2001 From: Jonathan Metzman Date: Fri, 5 Oct 2018 10:38:13 -0700 Subject: [PATCH] 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 Reviewed-by: Alex Loiko Cr-Commit-Position: refs/heads/master@{#25028} --- test/fuzzers/BUILD.gn | 1 + test/fuzzers/audio_processing_fuzzer_helper.cc | 4 ++-- test/fuzzers/packet_buffer_fuzzer.cc | 1 + test/fuzzers/rtcp_receiver_fuzzer.cc | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index aafe2d96ed..ccc15a6100 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -218,6 +218,7 @@ webrtc_fuzzer_test("rtcp_receiver_fuzzer") { ] 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 9989111c4d..073ab17bd9 100644 --- a/test/fuzzers/audio_processing_fuzzer_helper.cc +++ b/test/fuzzers/audio_processing_fuzzer_helper.cc @@ -30,7 +30,7 @@ void GenerateFloatFrame(test::FuzzDataHelper* fuzz_data, 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(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 @@ void GenerateFixedFrame(test::FuzzDataHelper* fuzz_data, 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(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 8ad21e1417..d226764cb2 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 d87e002f67..cd763d0f60 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"