Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-slice potentially large ArrayBuffers to avoid RangeErrors from GLTFLoader #9828

Closed
wants to merge 1 commit into from

Conversation

richtr
Copy link
Contributor

@richtr richtr commented Oct 7, 2016

This bug fix prevents passing a potentially very large ArrayBuffer in to Float32Array.prototype.set.

By pre-slicing the ArrayBuffer object to the required values it prevents the browser from throwing a RangeError: Source is too large error in the case that the original un-sliced input ArrayBuffer object is too large (when we are are only really interested in a small subset of it).

@richtr
Copy link
Contributor Author

richtr commented Oct 7, 2016

FWIW, this issue only affects three.js < r81 (i.e. prior to this change introduced in the r81 release).

@mrdoob
Copy link
Owner

mrdoob commented Oct 7, 2016

Maybe we should add a if ( THREE.REVISION < 81 )?

@richtr
Copy link
Contributor Author

richtr commented Oct 10, 2016

This change does not affect newer versions. It just means the loader works with older versions and newer versions. Maybe we don't need the revision check?

@mrdoob
Copy link
Owner

mrdoob commented Oct 10, 2016

Well... The proposed code is not as readable as the current one. That's code that we'll have to maintain in the future, so by adding the revision check the next person that reads the code will understand why it's like that.

@donmccurdy
Copy link
Collaborator

Closing, as this seems to be obsolete.

@donmccurdy donmccurdy closed this Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants