Bug 229325 - Decoding webm file with more than 2 channels will fail
Summary: Decoding webm file with more than 2 channels will fail
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks: 227111
  Show dependency treegraph
 
Reported: 2021-08-20 00:58 PDT by Jean-Yves Avenard [:jya]
Modified: 2021-09-09 08:32 PDT (History)
8 users (show)

See Also:


Attachments
Patch (24.30 KB, patch)
2021-09-07 19:19 PDT, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2021-08-20 00:58:21 PDT
Decoding of webm with more than 2 channels will fail with a decoding error.

STR:
1- Open https://jyavenard.github.io/htmltests/tests/webaudio/decodeAudioData.html
2- Select opus-mapping2.webm in the drop down list
3- press play

Result: will show a decoding error as context.decodeAudioData return an error
Comment 1 Radar WebKit Bug Importer 2021-08-20 00:58:49 PDT
<rdar://problem/82160691>
Comment 2 Jean-Yves Avenard [:jya] 2021-09-07 19:19:20 PDT
Created attachment 437580 [details]
Patch
Comment 3 Eric Carlson 2021-09-08 09:42:28 PDT
Comment on attachment 437580 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437580&action=review

> Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:175
> +        setVorbisChannelMap(layout, cookie.channelCount);

Why do you set the *Vorbis* channel map with an Opus cookie? A comment would be helpful.
Comment 4 Jean-Yves Avenard [:jya] 2021-09-08 15:41:45 PDT
Comment on attachment 437580 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437580&action=review

> Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:176
> +        m_channelLayout = layout;

https://datatracker.ietf.org/doc/html/rfc7845#section-5.1.1.2

mapping family one uses the vorbis layout.
Comment 5 Eric Carlson 2021-09-09 08:32:00 PDT
Comment on attachment 437580 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437580&action=review

>> Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:176
>> +        m_channelLayout = layout;
> 
> https://datatracker.ietf.org/doc/html/rfc7845#section-5.1.1.2
> 
> mapping family one uses the vorbis layout.

Yes, my point is that someone unfamiliar with the RFC may be confused by code so a comment would be helpful.