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

Add validation for callsubr and callgsubr for type 2 charstrings. #6724

Merged
merged 1 commit into from
Jan 5, 2016

Conversation

brendandahl
Copy link
Contributor

Fixes all the issues in #5929
and Fixes #6565

@brendandahl
Copy link
Contributor Author

Looks like I made #6286 worse, will look into a bit later.

@Snuffleupagus
Copy link
Collaborator

@brendandahl Nice patch, but it looks like you forgot to add the test in test_manifest.json.

subrsIndex = globalSubrIndex;
}
if (!subrsIndex) {
warn('Missing subrsIndex for ' + validationCommand.id);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will throw an error if validationCommand === null, which is what happens with the PDF file from #3117 (comment).

@brendandahl
Copy link
Contributor Author

I had to add localsubr selection for CID fonts.
/botio test

@brendandahl
Copy link
Contributor Author

Forgot the test manifest again...

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/5d8d10d92963cb6/output.txt

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/9f3b236e39c0970/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/727d62832ea9edc/output.txt

if (validationCommand.stem) {
hints += stackSize >> 1;
state.stackSize = stackSize;
return this.parseCharString(state, subrsIndex.get(subrNumber),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to continue parsing if this.parseCharString returns true.

Also, we need to track depths of the recursion and reject the charstring if it's too deep.

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/9f3b236e39c0970/output.txt

Total script time: 19.17 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/727d62832ea9edc/output.txt

Total script time: 19.57 mins

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

CFFFDSelect.prototype = {
getFDIndex: function CFFFDSelect_get(glyphIndex) {
if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) {
return false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Based on the name of the function, you might expect it to always return an integer, so would it make sense to instead return -1 in this case?

@timvandermeij
Copy link
Contributor

There are some remaining comments above. Could you squash the commits afterwards?

@brendandahl brendandahl force-pushed the callsubr branch 2 times, most recently from 7d33e16 to eb7c36b Compare January 5, 2016 17:53
@brendandahl
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2016

From: Bot.io (Windows)


Received

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

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

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2016

From: Bot.io (Linux)


Received

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

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

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2016

From: Bot.io (Windows)


Success

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

Total script time: 21.14 mins

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

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2016

From: Bot.io (Linux)


Success

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

Total script time: 21.72 mins

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

@yurydelendik
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2016

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/2471204e3332cbe/output.txt

@yurydelendik
Copy link
Contributor

/botio makeref

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2016

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/25fcfc9ba2ab714/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2016

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/565d0c3c7f1d31b/output.txt

@yurydelendik
Copy link
Contributor

Thank you for the patch

yurydelendik added a commit that referenced this pull request Jan 5, 2016
Add validation for callsubr and callgsubr for type 2 charstrings.
@yurydelendik yurydelendik merged commit 62ade3e into mozilla:master Jan 5, 2016
@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2016

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/25fcfc9ba2ab714/output.txt

Total script time: 21.01 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2016

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/565d0c3c7f1d31b/output.txt

Total script time: 21.12 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants