Backed out changeset 21491130777e (bug 1848660) for causing assertion failures on Casting.h. CLOSED TREE

This commit is contained in:
Natalia Csoregi 2023-08-16 21:02:47 +03:00
Родитель 465a62b2b1
Коммит 263a227ec9
4 изменённых файлов: 5 добавлений и 19 удалений

Просмотреть файл

@ -1,10 +0,0 @@
<html class="reftest-wait">
<audio id='a'>
<source src='1848660.wav'>
</audio>
<script>
function done() {
document.documentElement.removeAttribute("class");
}
a.addEventListener('error', done, true)
</script>

Двоичные данные
dom/media/test/crashtests/1848660.wav

Двоичный файл не отображается.

Просмотреть файл

@ -168,4 +168,3 @@ load 1840002.webm
load 1845350.mp4
load noextradata-8ch.html
load invalidfmt.html
load 1848660.html

Просмотреть файл

@ -701,24 +701,21 @@ uint16_t FormatChunk::ExtraFormatInfoSize() const {
}
AudioConfig::ChannelLayout::ChannelMap FormatChunk::ChannelMap() const {
// Regular mapping if file doesn't have channel mapping info. Alternatively,
// if the chunk size doesn't have the field for the size of the extension
// data, return a regular mapping.
// Regular mapping if file doesn't have channel mapping info, of if the chunk
// size doesn't have the field for the size of the extension data.
if (WaveFormat() != 0xFFFE || mRaw.Length() < 18) {
return AudioConfig::ChannelLayout(Channels()).Map();
}
// The length of this chunk is at least 18, check if it's long enough to
// hold the WAVE_FORMAT_EXTENSIBLE struct, that is 22 bytes. If not, fall
// back to a common mapping. The channel mapping is four bytes, starting at
// offset 18.
if (ExtraFormatInfoSize() < 22 || mRaw.Length() < 22) {
// back to a common mapping.
if (ExtraFormatInfoSize() < 22) {
return AudioConfig::ChannelLayout(Channels()).Map();
}
// ChannelLayout::ChannelMap is by design bit-per-bit compatible with
// WAVEFORMATEXTENSIBLE's dwChannelMask attribute, we can just cast here.
auto channelMap = static_cast<AudioConfig::ChannelLayout::ChannelMap>(
return static_cast<AudioConfig::ChannelLayout::ChannelMap>(
mRaw[21] | mRaw[20] | mRaw[19] | mRaw[18]);
return channelMap;
}
// DataParser