mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-02 21:33:52 +02:00
Validate audio codec strings
This commit is contained in:
@@ -742,7 +742,9 @@ export const dOps = (trackData: IsobmffAudioTrackData) => {
|
||||
// https://www.rfc-editor.org/rfc/rfc7845#section-5
|
||||
const description = trackData.info.decoderConfig?.description;
|
||||
if (description) {
|
||||
assert(description.byteLength >= 18); // Is validated in an earlier step
|
||||
if (description.byteLength < 18) {
|
||||
throw new Error('Opus decoder description is too short (must be at least 18 bytes).');
|
||||
}
|
||||
|
||||
const view = ArrayBuffer.isView(description)
|
||||
? new DataView(description.buffer, description.byteOffset, description.byteLength)
|
||||
|
||||
Reference in New Issue
Block a user