Skip to content

Commit c92a518

Browse files
committed
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.
1 parent 4015e7f commit c92a518

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/js/s14e-serializer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,10 +851,11 @@ const _deserialize = ( ) => {
851851
case I_DATAVIEW: {
852852
const byteOffset = deserializeLargeUint();
853853
const length = deserializeLargeUint();
854+
const ref = refCounter++;
854855
const arrayBuffer = _deserialize();
855856
const ctor = toArrayBufferViewConstructor[`${type}`];
856857
const out = new ctor(arrayBuffer, byteOffset, length);
857-
readRefs.set(refCounter++, out);
858+
readRefs.set(ref, out);
858859
return out;
859860
}
860861
default:

0 commit comments

Comments
 (0)