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

Update getMatroskaUint to handle larger integer values #4136

Conversation

kv-bh
Copy link
Contributor

@kv-bh kv-bh commented Mar 7, 2023

Currently, EBMLParser.getMatroskaUint will fail for values exceeding 0x7FFFFFFF due to JavaScript's bitwise operators converting numbers to 32-bit signed integers. This change should partially improve the handling of values when size is 5 or greater, up to Number.MAX_SAFE_INTEGER.

Since JavaScript numbers using 64-bit floats under the hood, this function will still fail if the value would exceed MAX_SAFE_INTEGER. As such, an error is thrown in these cases. To resolve this, BigInt or some counterpart would likely have to be used, which goes beyond the scope of what this PR is intending to change.

From what I can tell, this should mostly resolve #3247, and should enable support for video sizes of up to 256TB, rather than 2GB.

@dsilhavy dsilhavy added this to the 4.7.0 milestone Mar 17, 2023
@dsilhavy dsilhavy self-requested a review March 17, 2023 17:01
@dsilhavy
Copy link
Collaborator

@kv-bh Thank you. Following our contribution guidelines, and since this seems to be your first PR, could you please send me a signed copy of dash.js feedback agreement?

@dsilhavy dsilhavy merged commit 533b074 into Dash-Industry-Forum:development Mar 27, 2023
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.

Request range is negative in large video
2 participants