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

fix: Forbid usage of instanceof ArrayBuffer #7653

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

tykus160
Copy link
Member

Fixes #6279

@tykus160 tykus160 added type: bug Something isn't working correctly priority: P3 Useful but not urgent labels Nov 22, 2024
@tykus160
Copy link
Member Author

@shaka-bot test

@shaka-bot
Copy link
Collaborator

@tykus160: Lab tests started with arguments:

  • pr=7653

@tykus160
Copy link
Member Author

Lab tests are needed before merge to ensure ArrayBuffer.isView() is available on older platforms.

@avelad avelad added this to the v4.13 milestone Nov 22, 2024
@avelad
Copy link
Member

avelad commented Nov 22, 2024

@tykus160 I think to cover all cases of #6279 we should also remove the use of instanceof Uint8Array

@tykus160
Copy link
Member Author

@avelad Uint8Array is a bit different kind of beast. The closest we can do is to check ArrayBuffer.isView(view) && view.BYTES_PER_ELEMENT === 1 but it still can be Int8Array.

@avelad
Copy link
Member

avelad commented Nov 25, 2024

@avelad Uint8Array is a bit different kind of beast. The closest we can do is to check ArrayBuffer.isView(view) && view.BYTES_PER_ELEMENT === 1 but it still can be Int8Array.

The library doesn't use Int8Array so it should be safe to do that.

@avelad
Copy link
Member

avelad commented Nov 26, 2024

@shaka-bot test

@shaka-bot
Copy link
Collaborator

@avelad: Lab tests started with arguments:

  • pr=7653

@tykus160 tykus160 merged commit 55b7bd0 into shaka-project:main Nov 26, 2024
27 of 32 checks passed
@tykus160 tykus160 deleted the wt-isarraybuffer branch November 26, 2024 10:23
avelad pushed a commit that referenced this pull request Nov 27, 2024
avelad pushed a commit that referenced this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: P3 Useful but not urgent type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encrypted media playback freezes on documentPip if pssh is obtained from the media
4 participants