-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Only skip parsing a stream in Parser_makeFilter
when we know for sure that it is empty (PR 6372 follow-up)
#7670
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
Only skip parsing a stream in Parser_makeFilter
when we know for sure that it is empty (PR 6372 follow-up)
#7670
Conversation
…re that it is empty (PR 6372 follow-up) For PDF files with multiple `/Filter`s, where the `/Length` entry is zero, we fail to render the file correctly. The reason is that `maybeLength` is `null` for the every filter except the first, and `!maybeLength` is thus truthy. Hence it seems that we should completely ignore the `/Length` entry and also explicitly check `maybeLength === 0`. Note that I've not (yet) come across a PDF file with this issue in the wild, but given all the stupid things PDF generators do I wouldn't be surprised if such a file actually exists. In order to prevent a possible future bug, I'm submitting this patch which includes a hand-edited PDF file that we currently cannot render correctly (but e.g. Adobe Reader can).
/botio test |
1 similar comment
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/122f62dad532b89/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/c1ac9ecc029804b/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/122f62dad532b89/output.txt Total script time: 25.28 mins
Image differences available at: http://107.22.172.223:8877/122f62dad532b89/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/c1ac9ecc029804b/output.txt Total script time: 28.34 mins
Image differences available at: http://107.21.233.14:8877/c1ac9ecc029804b/reftest-analyzer.html#web=eq.log |
I've opened https://bugzilla.mozilla.org/show_bug.cgi?id=1305963 for the regression in the |
The upstream bug has now been fixed! However, it's not been uplifted to Firefox 51 yet, but again I don't think that needs to hold off landing this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch.
/botio makeref |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/7750eb212e778f3/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/b52b0e5ab7a5dc0/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/b52b0e5ab7a5dc0/output.txt Total script time: 25.19 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/7750eb212e778f3/output.txt Total script time: 27.43 mins
|
…maybeLength Only skip parsing a stream in `Parser_makeFilter` when we know for sure that it is empty (PR 6372 follow-up)
For PDF files with multiple
/Filter
s, where the/Length
entry is zero, we fail to render the file correctly. The reason is thatmaybeLength
isnull
for the every filter except the first, and!maybeLength
is thus truthy.Hence it seems that we should completely ignore the
/Length
entry and also explicitly checkmaybeLength === 0
.Note that I've not (yet) come across a PDF file with this issue in the wild, but given all the stupid things PDF generators do I wouldn't be surprised if such a file actually exists. In order to prevent a possible future bug, I'm submitting this patch which includes a hand-edited PDF file that we currently cannot render correctly (but e.g. Adobe Reader can).