mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
47.96k stars 9.92k forks source link

[Bug]: unhandledRejection: incorrect data check #18632

Closed markb-trustifi closed 3 weeks ago

markb-trustifi commented 3 weeks ago

Attach (recommended) or Link to PDF file

This Unhandled Rejection is thrown in nodeJS when I open some specific PDF file:

Promise { { Error: incorrect data check
at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at Zlib.zlibOnError [as onerror] (node:zlib:189:17)
at Zlib.callbackTrampoline (node:internal/async_hooks:130:17)
errno: -3,
code: 'Z_DATA_ERROR' }, [Symbol(async_id_symbol)]: 19047, [Symbol(trigger_async_id_symbol)]: 19027 } } }

It also occurs in the web browser when I open the same file in the viewer: https://mozilla.github.io/pdf.js/web/viewer.html

Uncaught (in promise) 
TypeError: The compressed data was not valid: incorrect data check.

Web browser and its version

Chrome 127

Operating system and its version

MacOS 12.7.5

PDF.js version

4.5.136

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. open web viewer: https://mozilla.github.io/pdf.js/web/viewer.html
  2. open PDF file
  3. see exception in dev console

What is the expected behavior?

no errors

What went wrong?

there is error in dev console in browser and unhandled rejection in nodeJS:

process.on('unhandledRejection', (reason, promise) => {
   console.error(reason);
});

Link to a viewer

No response

Additional context

It happens only with some specific PDF file. Please give me your private email and I'll send it to you.

markb-trustifi commented 3 weeks ago

@Snuffleupagus please write an email where I can send my PDF file.

Snuffleupagus commented 3 weeks ago

please write an email where I can send my PDF file.

Please note that we want publicly available test-cases to make issues actionable for any contributor, since this is an open-source project that you're able to use for free. Furthermore, trying to create reduced test-cases can be really difficult and time-consuming in general; what if every issue required that unpaid contributors did that work?

Sorry, but personally I'm not able to help here (unless you're willing to compensate me for my time).

timvandermeij commented 3 weeks ago

Closing since we aren't able to help without a publicly available PDF file as requested in the issue template. If the file contains sensitive information, please try to create or find another file without such contents that also triggers the issue.