mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-01 12:53:49 +02:00
Add strict slice range validation, fix RF64 reading error (fixes #146)
This commit is contained in:
@@ -102,8 +102,12 @@ export class WaveDemuxer extends Demuxer {
|
||||
} else if (chunkId === 'ds64') {
|
||||
// File and data chunk sizes are defined in here instead
|
||||
|
||||
const riffChunkSize = readU64(slice, littleEndian);
|
||||
dataChunkSize = readU64(slice, littleEndian);
|
||||
let ds64Slice = this.reader.requestSlice(startPos, chunkSize);
|
||||
if (ds64Slice instanceof Promise) ds64Slice = await ds64Slice;
|
||||
if (!ds64Slice) break;
|
||||
|
||||
const riffChunkSize = readU64(ds64Slice, littleEndian);
|
||||
dataChunkSize = readU64(ds64Slice, littleEndian);
|
||||
|
||||
totalFileSize = Math.min(riffChunkSize + 8, this.reader.fileSize ?? Infinity);
|
||||
} else if (chunkId === 'LIST') {
|
||||
|
||||
Reference in New Issue
Block a user