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

Use stringToPDFString to sanitizing bad "Prefix" entries in Page Label dictionaries, and add more validation #7782

Merged
merged 2 commits into from
Nov 3, 2016
Merged

Conversation

Snuffleupagus
Copy link
Collaborator

  • Use stringToPDFString to sanitizing bad "Prefix" entries in Page Label dictionaries

    It seems that certain bad PDF generators can create badly encoded "Prefix" entries for Page Labels, one example being http://ukjewishfilm.org/wp-content/uploads/2015/09/Jewish-Film-Festival-Programme-ONLINE.pdf.

    Unfortunately I didn't come across such a PDF file while adding the API support for Page Labels, but with them now being used in the viewer I just found this issue. With this patch, we now display the Page Labels in the same way as Adobe Reader.

  • Add a bit more validation to Catalog_readPageLabels, to ensure that the Page Labels are well formed

…bel dictionaries

It seems that certain bad PDF generators can create badly encoded "Prefix" entries for Page Labels, one example being http://ukjewishfilm.org/wp-content/uploads/2015/09/Jewish-Film-Festival-Programme-ONLINE.pdf.

Unfortunately I didn't come across such a PDF file while adding the API support for Page Labels, but with them now being used in the viewer I just found this issue. With this patch, we now display the Page Labels in the same way as Adobe Reader.
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

pdfjsbot commented Nov 3, 2016

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/7dd96ebb03a0393/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 3, 2016

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/15949ed00403501/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 3, 2016

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/15949ed00403501/output.txt

Total script time: 2.53 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Nov 3, 2016

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/7dd96ebb03a0393/output.txt

Total script time: 2.63 mins

  • Unit Tests: Passed

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Nov 3, 2016

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/6a75e91fcd58d6b/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 3, 2016

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/6a75e91fcd58d6b/output.txt

Total script time: 2.61 mins

Published

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Nov 3, 2016

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/906d05061851125/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 3, 2016

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/447c4dc95d8f6ba/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 3, 2016

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/906d05061851125/output.txt

Total script time: 25.62 mins

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

@pdfjsbot
Copy link

pdfjsbot commented Nov 3, 2016

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/447c4dc95d8f6ba/output.txt

Total script time: 38.00 mins

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

@timvandermeij timvandermeij merged commit 1d82521 into mozilla:master Nov 3, 2016
@timvandermeij
Copy link
Contributor

Looks good, thanks!

@Snuffleupagus Snuffleupagus deleted the page-labels-more-validation branch November 3, 2016 21:22
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
…alidation

Use `stringToPDFString` to sanitizing bad "Prefix" entries in Page Label dictionaries, and add more validation
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