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

Prevent infinite loop when scanning for endstream (bug 1020226) #4902

Merged
merged 1 commit into from
Jun 10, 2014
Merged

Prevent infinite loop when scanning for endstream (bug 1020226) #4902

merged 1 commit into from
Jun 10, 2014

Conversation

Snuffleupagus
Copy link
Collaborator

Note: even with this patch, the file referenced in the bug still doesn't load in PDF.js. However I think this is OK, since even Adobe Reader won't open the file (it just displays a message saying that the file is damaged).

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Jun 7, 2014

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/1afa9821b6c1ac4/output.txt

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Jun 7, 2014

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/fb6023affb100d8/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jun 7, 2014

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/2a81f514cca68b3/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jun 7, 2014

From: Bot.io (Windows)


Failed

Full output at http://107.22.172.223:8877/fb6023affb100d8/output.txt

Total script time: 23.20 mins

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

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

@pdfjsbot
Copy link

pdfjsbot commented Jun 7, 2014

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/2a81f514cca68b3/output.txt

Total script time: 26.15 mins

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

@@ -266,6 +266,9 @@ var Parser = (function ParserClosure() {
while (stream.pos < stream.end) {
var scanBytes = stream.peekBytes(SCAN_BLOCK_SIZE);
var scanLength = scanBytes.length - ENDSTREAM_SIGNATURE_LENGTH;
if (scanLength === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use scanLength <= 0 here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@yurydelendik
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/c1028edb07ee000/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/308397cc8106769/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/308397cc8106769/output.txt

Total script time: 21.19 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/c1028edb07ee000/output.txt

Total script time: 26.09 mins

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

yurydelendik added a commit that referenced this pull request Jun 10, 2014
Prevent infinite loop when scanning for endstream (bug 1020226)
@yurydelendik yurydelendik merged commit 2da1942 into mozilla:master Jun 10, 2014
@yurydelendik
Copy link
Contributor

Thank you

@Snuffleupagus Snuffleupagus deleted the bug-1020226 branch June 10, 2014 14:18
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