1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Merge pull request #18766 from Snuffleupagus/issue-18765

Ignore non-existing /Shading resources during parsing (issue 18765)
This commit is contained in:
Jonas Jenwald 2024-09-21 21:11:53 +02:00 committed by GitHub
commit ea2172e754
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 7 deletions

View file

@ -2132,14 +2132,26 @@ class PartialEvaluator {
break;
case OPS.shadingFill:
var shadingRes = resources.get("Shading");
if (!shadingRes) {
throw new FormatError("No shading resource found");
}
let shading;
try {
const shadingRes = resources.get("Shading");
if (!shadingRes) {
throw new FormatError("No shading resource found");
}
var shading = shadingRes.get(args[0].name);
if (!shading) {
throw new FormatError("No shading object found");
shading = shadingRes.get(args[0].name);
if (!shading) {
throw new FormatError("No shading object found");
}
} catch (reason) {
if (reason instanceof AbortException) {
continue;
}
if (self.options.ignoreErrors) {
warn(`getOperatorList - ignoring Shading: "${reason}".`);
continue;
}
throw reason;
}
const patternId = self.parseShading({
shading,

View file

@ -0,0 +1 @@
https://github.com/user-attachments/files/17065251/LUCID.-.Asif.Rasha-1.pdf

View file

@ -3021,6 +3021,16 @@
"lastPage": 1,
"type": "eq"
},
{
"id": "issue18765",
"file": "pdfs/issue18765.pdf",
"md5": "7763ead2aa69db3a5263f92bb1922e31",
"link": true,
"talos": false,
"rounds": 1,
"lastPage": 1,
"type": "eq"
},
{
"id": "issue11139",
"file": "pdfs/issue11139.pdf",