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

Support corrupt documents with *empty* Name-entries (issue 13610) #13612

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

Apparently some really bad PDF software can create documents with empty Name-entries, which we thus need to somehow deal with.
While I don't know if this patch is necessarily the best solution, it should at least ensure that the empty Name-instance cannot accidentally match a proper Name-instance (and it doesn't require changes to a lot of existing code).[1]


[1] I briefly considered using a Symbol rather than an Object, but quickly decided against that since the former one is not clonable and Name-instances may be sent to the API.

Apparently some really bad PDF software can create documents with *empty* `Name`-entries, which we thus need to somehow deal with.
While I don't know if this patch is necessarily the best solution, it should at least ensure that the *empty* `Name`-instance cannot accidentally match a proper `Name`-instance (and it doesn't require changes to a lot of existing code).[1]

---
[1] I briefly considered using a `Symbol` rather than an Object, but quickly decided against that since the former one [is not clonable](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#supported_types) and `Name`-instances may be sent to the API.
@Snuffleupagus Snuffleupagus linked an issue Jun 22, 2021 that may be closed by this pull request
@Snuffleupagus
Copy link
Collaborator Author

For once I've not run the entire test-suite locally, since it's already hot enough around here, so hopefully there won't be any regressions with this patch :-)

/botio test

@pdfjsbot
Copy link

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/9befdf2d344249d/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/d40aa7576b705af/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/9befdf2d344249d/output.txt

Total script time: 28.54 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 10
  different first/second rendering: 1

Image differences available at: http://54.67.70.0:8877/9befdf2d344249d/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/d40aa7576b705af/output.txt

Total script time: 32.68 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 7
  different first/second rendering: 1

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

@Snuffleupagus Snuffleupagus marked this pull request as draft June 22, 2021 18:33
@Snuffleupagus Snuffleupagus marked this pull request as ready for review June 22, 2021 18:35
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/0b1262c77e8a97c/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/0b1262c77e8a97c/output.txt

Total script time: 4.78 mins

Published

@timvandermeij timvandermeij merged commit ad4b2ce into mozilla:master Jun 23, 2021
@timvandermeij
Copy link
Contributor

Let's do this; thanks!

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/7ded528c683c037/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_makeref from @timvandermeij received. Current queue size: 1

Live output at: http://3.101.106.178:8877/315113178b9f1d2/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/7ded528c683c037/output.txt

Total script time: 25.28 mins

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/315113178b9f1d2/output.txt

Total script time: 29.82 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.

Header line of document wasn't showed
3 participants