"TypeError: info.PDFFormatVersion is undefined" when PDF header is invalid
Categories
(Firefox :: PDF Viewer, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox71 | --- | wontfix |
firefox72 | --- | wontfix |
firefox73 | --- | verified |
People
(Reporter: robwu, Assigned: Snuffleupagus)
References
(Regression, )
Details
(Keywords: regression)
When the PDF version cannot be extracted from a PDF file, the PDF can still be displayed properly, but the console contains the following error:
TypeError: info.PDFFormatVersion is undefined
As a result, such PDF files won't be recorded in telemetry.
To reproduce, edit a PDF file and replace the %PDF-x.x
part with whitespace. Then open that PDF file in Firefox (with MIME-type application/pdf; either from a server, or just from file://
).
Reporter | ||
Comment 1•5 years ago
|
||
This regression is caused by https://github.com/mozilla/pdf.js/commit/31d71808e7f663af9eccd18da10009102a1702d7
Previously, the missing value was serialized as "undefined", and converted to an integer before sent to telemetry. The value would be reported as 0.
Now, due to the runtime error, nothing is sent to telemetry any more. I think that "other"
would make more sense here.
Reporter | ||
Comment 2•5 years ago
|
||
Fixed by https://github.com/mozilla/pdf.js/pull/11463
Brendan, could you take care of evaluating whether the patch should be merged with m-c, and/or uplifted?
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 3•5 years ago
|
||
I reproduced the issue on Firefox Nightly (2020-01-01) under Windows 10 (x64), following the instructions from Comment 1.
The issue is fixed on RC1 73.0. Tests were performed on Windows 10 (x64), macOS 10.15, and Ubuntu 18.04 (x64).
Updated•5 years ago
|
Description
•