mirror of
https://github.com/codedread/bitjs
synced 2025-10-04 01:59:15 +02:00
If there are not at least ten bytes in the arraybuffer, return a null unarchiver
This commit is contained in:
parent
e07990c4db
commit
f6fe788693
1 changed files with 4 additions and 0 deletions
|
@ -343,6 +343,10 @@ bitjs.archive.Untarrer = class extends bitjs.archive.Unarchiver {
|
||||||
* @return {bitjs.archive.Unarchiver}
|
* @return {bitjs.archive.Unarchiver}
|
||||||
*/
|
*/
|
||||||
bitjs.archive.GetUnarchiver = function(ab, opt_pathToBitJS) {
|
bitjs.archive.GetUnarchiver = function(ab, opt_pathToBitJS) {
|
||||||
|
if (ab.byteLength < 10) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
let unarchiver = null;
|
let unarchiver = null;
|
||||||
const pathToBitJS = opt_pathToBitJS || '';
|
const pathToBitJS = opt_pathToBitJS || '';
|
||||||
const h = new Uint8Array(ab, 0, 10);
|
const h = new Uint8Array(ab, 0, 10);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue