Skip to content

Fix masking of continuation bit in DecodeBase64VLQ #179

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

Merged
merged 1 commit into from
Mar 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -770,13 +770,13 @@
1. Assert: _first_ < 64.
1. If _first_ modulo 2 is 0, let _sign_ be 1.
1. Else, let _sign_ be -1.
1. Let _value_ be min(floor(_first_ / 2), 2<sup>4</sup> - 1).
1. Let _value_ be floor((_first_ modulo 2<sup>5</sup>) / 2).
1. Let _nextShift_ be 16.
1. Let _currentByte_ be _first_.
1. Repeat, while floor(_currentByte_ / 2<sup>5</sup>) modulo 2 = 1,
1. Repeat, while floor(_currentByte_ / 2<sup>5</sup>) = 1,
1. If _position_.[[Value]] = _segmentLen_, throw an error.
1. Set _currentByte_ to ConsumeBase64ValueAt(_segment_, _position_).
1. Let _chunk_ be min(_currentByte_, 2<sup>5</sup> - 1).
1. Let _chunk_ be _currentByte_ modulo 2<sup>5</sup>.
1. Set _value_ to _value_ + _chunk_ × _nextShift_.
1. If _value_ &ge; 2<sup>31</sup>, throw an error.
1. Set _nextShift_ to _nextShift_ × 2<sup>5</sup>.
Expand Down