Skip to content

fix: NCCBUG-175: BitReader/BitWriter Reading/writing more than 8 bits was producing the wrong result #2130

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

Conversation

ShadauxCat
Copy link
Collaborator

The calculation of where to read/write was incorrect. It was taking the parent reader/writer's position into account twice and not counting its own bit-based position.

NCCBUG-175

Changelog

  • Fixed: Fixed an issue where reading/writing more than 8 bits at a time with BitReader/BitWriter would write/read from the wrong place, returning and incorrect result.

Testing and Documentation

  • Includes unit tests.
  • No documentation changes or additions were necessary.

@ShadauxCat ShadauxCat requested a review from a team as a code owner August 17, 2022 18:39
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) August 17, 2022 22:16
@NoelStephensUnity NoelStephensUnity merged commit 7b6bcc6 into develop Aug 17, 2022
@NoelStephensUnity NoelStephensUnity deleted the fix/reading_more_than_8_bytes_returns_wrong_result branch August 17, 2022 23:47
jakobbbb pushed a commit to GooseGirlGames/com.unity.netcode.gameobjects that referenced this pull request Feb 22, 2023
… was producing the wrong result (Unity-Technologies#2130)

* fix: NCCBUG-175: BitReader/BitWriter Reading/writing more than 8 bits was producing the wrong result

* Standards + changelog

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
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.

4 participants