1
0
mirror of https://github.com/gorhill/uBlock.git synced 2025-01-31 12:11:36 +01:00

Fix deserialization of ArrayBuffer shared by multiple TypedArrays

Deserialization failed to restore proper ArrayBuffer when used by
multiple TypedArrays.

This didn't affect uBO since this specific code path was never
taken.
This commit is contained in:
Raymond Hill 2024-12-26 19:07:26 -05:00
parent 4015e7f772
commit c92a518218
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -851,10 +851,11 @@ const _deserialize = ( ) => {
case I_DATAVIEW: {
const byteOffset = deserializeLargeUint();
const length = deserializeLargeUint();
const ref = refCounter++;
const arrayBuffer = _deserialize();
const ctor = toArrayBufferViewConstructor[`${type}`];
const out = new ctor(arrayBuffer, byteOffset, length);
readRefs.set(refCounter++, out);
readRefs.set(ref, out);
return out;
}
default: