1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-28 23:28:16 +02:00
pdf.js/src/core
Jonas Jenwald d3e65f24e3 Request all data, rather than throwing, when encountering general errors in ObjectLoader._walk (issue 9462, PR 3289 follow-up)
*As far as I can tell, this has been broken ever since PR 3289 (back in 2013) without anyone noticing.*

For any non-`MissingDataException` errors encountered in `ObjectLoader._walk`, we're simply throwing immediately which thus has the potential to *completely* break rendering of an entire page.
In practice this is obviously only an issue for PDF documents which are in one way or another corrupt, since that's the only way that `XRef.fetch` will throw non-`MissingDataException` errors. To make matters worse these errors are *intermittent*, since they can only occur if the document is still loading when the `ObjectLoader`-code runs (note the early return in `ObjectLoader.load`).

Please note that we cannot simply catch the error and let "normal" parsing continue in `ObjectLoader._walk`, since that could lead to errors elsewhere given that resources "below" the current one (in the graph) might not be checked as intended then.
All-in-all, the only way to make absolutely sure that we won't cause *unexpected* `MissingDataException`s somewhere else in the code-base is to fallback to fetching the *entire* document in this edge-case.
2021-02-06 14:33:50 +01:00
..
xfa Merge pull request #12944 from calixteman/xfa_config 2021-02-05 15:06:09 -08:00
.eslintrc Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
annotation.js JS -- add support for choice widget (#12826) 2021-01-25 23:40:57 +01:00
arithmetic_decoder.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
bidi.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
ccitt.js Enable the dot-notation ESLint rule 2020-04-17 12:24:46 +02:00
ccitt_stream.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
cff_parser.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
charsets.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
chunked_stream.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
cmap.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
colorspace.js Remove the special handling, used when creating Indexed ColorSpaces, for the case where the lookup-data is a Stream 2020-07-10 17:22:55 +02:00
core_utils.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
crypto.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
default_appearance.js Ensure that parseDefaultAppearance won't attempt to access a not yet defined variable (PR 12831 follow-up) 2021-01-23 15:33:28 +01:00
document.js JS -- Add tests for print/save actions 2020-12-24 18:51:00 +01:00
encodings.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
evaluator.js Merge pull request #12922 from Snuffleupagus/getTextContent-globalImageCache 2021-01-28 23:44:10 +01:00
font_renderer.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
fonts.js Always re-measure non-embedded ArialNarrow fonts (bug 1671312, PR 12725 follow-up) 2021-01-14 15:51:48 +01:00
function.js Simplify the PDFFunctionFactory._localFunctionCache initialization (PR 12034 follow-up) 2021-01-22 12:25:05 +01:00
glyphlist.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
image.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
image_utils.js Ignore globally cached images in PartialEvaluator.getTextContent (PR 11930 follow-up) 2021-01-28 10:19:26 +01:00
jbig2.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
jbig2_stream.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
jpeg_stream.js [api-minor] Decode all JPEG images with the built-in PDF.js decoder in src/core/jpg.js 2020-05-22 00:22:48 +02:00
jpg.js Improve handling of JPEG images without an EOI marker (issue 12841) 2021-01-09 20:19:39 +01:00
jpx.js Ignore, rather than throwing on, unsupported Coding style default (COD) options in JPEG 2000 images (issue 11004) 2020-12-21 20:35:52 +01:00
jpx_stream.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
metrics.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
murmurhash3.js Ensure that MurmurHash3_64.update handles ArrayBuffer input correctly, to avoid hash-collisions (issue 12533) 2020-10-26 16:27:33 +01:00
obj.js Request all data, rather than throwing, when encountering general errors in ObjectLoader._walk (issue 9462, PR 3289 follow-up) 2021-02-06 14:33:50 +01:00
operator_list.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
parser.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
pattern.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
pdf_manager.js Allow GlobalImageCache.clear to, optionally, only remove the actual data (PR 11912 follow-up) 2020-05-23 11:30:24 +02:00
primitives.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
ps_parser.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
standard_fonts.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
stream.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
type1_parser.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
unicode.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
worker.js Remove redundant compatibility checks, for modern generic builds, in src/core/worker.js 2021-01-20 13:09:56 +01:00
worker_stream.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
writer.js Merge pull request #12838 from calixteman/authors 2021-01-12 02:44:58 -08:00