mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 13:53:53 +02:00
Make Mediabunny more resilient against data boxes ending abruptly
This commit is contained in:
@@ -70,6 +70,10 @@ export const readDataBox = (slice: FileSlice) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (slice.remainingLength < 4) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const typeIndicator = readU32Be(slice);
|
const typeIndicator = readU32Be(slice);
|
||||||
slice.skip(4); // Locale indicator
|
slice.skip(4); // Locale indicator
|
||||||
const data = readBytes(slice, header.contentSize - 8);
|
const data = readBytes(slice, header.contentSize - 8);
|
||||||
|
|||||||
Reference in New Issue
Block a user