From 263a227ec941e241f5a4714a62210c16eab334ce Mon Sep 17 00:00:00 2001 From: Natalia Csoregi Date: Wed, 16 Aug 2023 21:02:47 +0300 Subject: [PATCH] Backed out changeset 21491130777e (bug 1848660) for causing assertion failures on Casting.h. CLOSED TREE --- dom/media/test/crashtests/1848660.html | 10 ---------- dom/media/test/crashtests/1848660.wav | Bin 65 -> 0 bytes dom/media/test/crashtests/crashtests.list | 1 - dom/media/wave/WaveDemuxer.cpp | 13 +++++-------- 4 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 dom/media/test/crashtests/1848660.html delete mode 100644 dom/media/test/crashtests/1848660.wav diff --git a/dom/media/test/crashtests/1848660.html b/dom/media/test/crashtests/1848660.html deleted file mode 100644 index 7bebb9c896e9..000000000000 --- a/dom/media/test/crashtests/1848660.html +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/dom/media/test/crashtests/1848660.wav b/dom/media/test/crashtests/1848660.wav deleted file mode 100644 index d48cd9818ac0e0a567001d050b5e9f4cfce623ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmV-H0KWfHNk&GLxA*{8K~_a(ZFC?K0002~{|W#>A1(lZ@lO9j{RRL)0c2rxVaYSm XipWpR&&SHn&oMACParML&&p0hD##k; diff --git a/dom/media/test/crashtests/crashtests.list b/dom/media/test/crashtests/crashtests.list index 509de172b986..8f976d52ab54 100644 --- a/dom/media/test/crashtests/crashtests.list +++ b/dom/media/test/crashtests/crashtests.list @@ -168,4 +168,3 @@ load 1840002.webm load 1845350.mp4 load noextradata-8ch.html load invalidfmt.html -load 1848660.html diff --git a/dom/media/wave/WaveDemuxer.cpp b/dom/media/wave/WaveDemuxer.cpp index 3e0c4e443e3a..d06c5e396093 100644 --- a/dom/media/wave/WaveDemuxer.cpp +++ b/dom/media/wave/WaveDemuxer.cpp @@ -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( + return static_cast( mRaw[21] | mRaw[20] | mRaw[19] | mRaw[18]); - return channelMap; } // DataParser