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

Ensure that the peekByte methods, on the various Streams, handles end of data correctly (PR 5286 follow-up) #11301

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

Snuffleupagus
Copy link
Collaborator

When the end of data has already been reached for the various Streams, the getByte methods will return -1 to signal that to the caller. Note however that the current position obviously won't be incremented in this case, meaning that the peekByte methods will in this case incorrectly decrement the position.

Thankfully the corresponding peekBytes shouldn't be affected by this bug, since they decrement the current position with the actually returned number of bytes.

I'm not aware of any bugs caused by this blatant oversight, but that doesn't mean this shouldn't be fixed :-)

…nd of data correctly (PR 5286 follow-up)

When the end of data has already been reached for the various Streams, the `getByte` methods will return `-1` to signal that to the caller. Note however that the current position obviously won't be incremented in this case, meaning that the `peekByte` methods will in this case *incorrectly* decrement the position.

Thankfully the corresponding `peekBytes` shouldn't be affected by this bug, since they decrement the current position with the *actually* returned number of bytes.

I'm not aware of any bugs caused by this blatant oversight, but that doesn't mean this shouldn't be fixed :-)
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Nov 1, 2019

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/d8085246dd835f4/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 1, 2019

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/1bfa83f0d62eafe/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 1, 2019

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/1bfa83f0d62eafe/output.txt

Total script time: 18.62 mins

  • Font tests: Passed
  • Unit tests: FAILED
  • Regression tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Nov 1, 2019

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/d8085246dd835f4/output.txt

Total script time: 26.61 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.215.176.217:8877/d8085246dd835f4/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit 0eda75c into mozilla:master Nov 1, 2019
@timvandermeij
Copy link
Contributor

Thank you for fixing this!

@Snuffleupagus
Copy link
Collaborator Author

Well, I did cause it so fixing it was probably the least I could do here :-)

As always, thanks for reviewing and merging this!

@Snuffleupagus Snuffleupagus deleted the peekByte-eof branch November 2, 2019 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants