Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Bugfix: Samsung Galaxy S3 - Android Browser - Databuffer Boundary Bugfix #93

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Bugfix: Samsung Galaxy S3 - Android Browser - Databuffer Boundary Bugfix #93

wants to merge 1 commit into from

Conversation

JochenHeizmann
Copy link

The Android Browser in my Samsung Galaxy S3 (Android 4.4.2) does have a
problem that I haven't encountered in other Browsers:

Creating a buffer view with an buffer that has a size that isn't
a multiple of the base type creates an Exception:

ArrayBuffer length minus the byteOffset is not a multiple of the element size

This happened to me in a game where I'm loading a Binary File. Of course
it is possible that the size of this Binary File isn't a multiple of 4.

Now when Monkey tries to load in the File into a DataBuffer object the
above-mentioned Exception is thrown.

I've created a workaround in this pull request because I weren't able
to come up with a cleaner solution:

If the length of the buffer isn't a multiple of 4, I copy/resize the
buffer to be a multiple of 4 in length.

But I keep the original length property so that the seeking logic
remains the same.

The Android Browser in my Samsung Galaxy S3 (Android 4.4.2) does have a
problem that I haven't encountered in other Browsers:

Creating a buffer view with an buffer that has a size that isn't
a multiple of the base type creates an Exception:

ArrayBuffer length minus the byteOffset is not a multiple of the element size

This happened to me in a game where I'm loading a Binary File. Of course
it is possible that the size of this Binary File isn't a multiple of 4.

Now when Monkey tries to load in the File into a DataBuffer object the
above-mentioned Exception is thrown.

I've created a workaround in this pull request because I weren't able
to come up with a cleaner solution:

If the length of the buffer isn't a multiple of 4, I copy/resize the
buffer to be a multiple of 4 in length.

But I keep the original length property so that the seeking logic
remains the same.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant