Skip to content

Commit

Permalink
Fix deserialization of ArrayBuffer shared by multiple TypedArrays
Browse files Browse the repository at this point in the history
Deserialization failed to restore proper ArrayBuffer when used by
multiple TypedArrays.

This didn't affect uBO since this specific code path was never
taken.
  • Loading branch information
gorhill committed Dec 27, 2024
1 parent 4015e7f commit c92a518
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/s14e-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c92a518

Please sign in to comment.