Skip to content

Prevent adding invalid values in CFFDict_setByKey (bug 1068432) #7300

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
merged 1 commit into from
May 24, 2016
Merged

Prevent adding invalid values in CFFDict_setByKey (bug 1068432) #7300

merged 1 commit into from
May 24, 2016

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented May 7, 2016

In the font in question, there are a couple of topDict entries that have invalid values (0xF 0xF, i.e. just eof markers without any actual numbers).
This causes the parseFloatOperand function, inside CFFParser_parseDict, to return NaN. Currently we pass this broken font onto the browser, which OTS unsurprisingly rejects.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1068432.

Please note: I think that this might actually be the first time that I fix a bug in a CFF font, so I'm not sure if the patch is the best possible solution, but it does work!

r? @brendandahl

In the font in question, there are a couple of `topDict` entries that have invalid values (`0xF 0xF`, i.e. just eof markers without any actual numbers).
This causes the `parseFloatOperand` function, inside `CFFParser_parseDict`, to return `NaN`. Currently we pass this broken font onto the browser, which OTS unsurprisingly rejects.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1068432.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented May 7, 2016

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/0ba6dd990deb438/output.txt

@pdfjsbot
Copy link

pdfjsbot commented May 7, 2016

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/21565eba93e3958/output.txt

@pdfjsbot
Copy link

pdfjsbot commented May 7, 2016

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/0ba6dd990deb438/output.txt

Total script time: 21.77 mins

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

@pdfjsbot
Copy link

pdfjsbot commented May 7, 2016

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/21565eba93e3958/output.txt

Total script time: 27.81 mins

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

@brendandahl
Copy link
Contributor

@Snuffleupagus Woot, first CFF bug!

/botio-makeref

@brendandahl
Copy link
Contributor

can't type
/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

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

Total script time: 21.16 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

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

Total script time: 26.86 mins

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

@brendandahl brendandahl merged commit b86610f into mozilla:master May 24, 2016
@Snuffleupagus Snuffleupagus deleted the bug-1068432 branch May 24, 2016 19:17
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.

3 participants