Skip to content

Commit

Permalink
IPC fuzzer: fix a compile failure from refactoring of media::AudioPar…
Browse files Browse the repository at this point in the history
…ameters.

Caused by https://crrev.com/2e2f1c71bec505f3ae9d718dd8e875fedd4962e7

[email protected]

Review URL: https://codereview.chromium.org/1335673003

Cr-Commit-Position: refs/heads/master@{#348170}
  • Loading branch information
mbarbella-chromium authored and Commit bot committed Sep 10, 2015
1 parent aad8a57 commit a001958
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tools/ipc_fuzzer/fuzzer/fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1337,17 +1337,20 @@ struct FuzzTraits<LOGFONT> {
template <>
struct FuzzTraits<media::AudioParameters> {
static bool Fuzz(media::AudioParameters* p, Fuzzer* fuzzer) {
int format = p->format();
int channel_layout = p->channel_layout();
int format = p->format();
int sample_rate = p->sample_rate();
int bits_per_sample = p->bits_per_sample();
int frames_per_buffer = p->frames_per_buffer();
int channels = p->channels();
int effects = p->effects();
// TODO(mbarbella): Support ChannelLayout mutation and invalid values.
if (fuzzer->ShouldGenerate()) {
channel_layout =
RandInRange(media::ChannelLayout::CHANNEL_LAYOUT_MAX + 1);
}
if (!FuzzParam(&format, fuzzer))
return false;
if (!FuzzParam(&channel_layout, fuzzer))
return false;
if (!FuzzParam(&sample_rate, fuzzer))
return false;
if (!FuzzParam(&bits_per_sample, fuzzer))
Expand All @@ -1360,8 +1363,10 @@ struct FuzzTraits<media::AudioParameters> {
return false;
media::AudioParameters params(
static_cast<media::AudioParameters::Format>(format),
static_cast<media::ChannelLayout>(channel_layout), channels,
sample_rate, bits_per_sample, frames_per_buffer, effects);
static_cast<media::ChannelLayout>(channel_layout), sample_rate,
bits_per_sample, frames_per_buffer);
params.set_channels_for_discrete(channels);
params.set_effects(effects);
*p = params;
return true;
}
Expand Down

0 comments on commit a001958

Please sign in to comment.