From edef5721185d3263dc12091fd6c08e9b2840c215 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Fri, 31 Jan 2014 13:50:45 -0800 Subject: [PATCH] Bug 966311 - Calculate frame size for stereo wave. r=doublec We were assuming 8-bit WAVE files were mono-only, but this is not necessarily the case. --- content/media/wave/WaveReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/media/wave/WaveReader.cpp b/content/media/wave/WaveReader.cpp index 74d1f7182a0..3badd35d448 100644 --- a/content/media/wave/WaveReader.cpp +++ b/content/media/wave/WaveReader.cpp @@ -424,7 +424,7 @@ WaveReader::LoadFormatChunk(uint32_t aChunkSize) // but the channels check is intentionally limited to mono or stereo // when the media is intended for direct playback because that's what the // audio backend currently supports. - unsigned int actualFrameSize = sampleFormat == 8 ? 1 : 2 * channels; + unsigned int actualFrameSize = (sampleFormat == 8 ? 1 : 2) * channels; if (rate < 100 || rate > 96000 || (((channels < 1 || channels > MAX_CHANNELS) || (frameSize != 1 && frameSize != 2 && frameSize != 4)) &&