Ignore non-existing /Shading resources during parsing (issue 18765)
This commit is contained in:
parent
96cdff4a73
commit
67af371e58
@ -2132,14 +2132,26 @@ class PartialEvaluator {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case OPS.shadingFill:
|
case OPS.shadingFill:
|
||||||
var shadingRes = resources.get("Shading");
|
let shading;
|
||||||
if (!shadingRes) {
|
try {
|
||||||
throw new FormatError("No shading resource found");
|
const shadingRes = resources.get("Shading");
|
||||||
}
|
if (!shadingRes) {
|
||||||
|
throw new FormatError("No shading resource found");
|
||||||
|
}
|
||||||
|
|
||||||
var shading = shadingRes.get(args[0].name);
|
shading = shadingRes.get(args[0].name);
|
||||||
if (!shading) {
|
if (!shading) {
|
||||||
throw new FormatError("No shading object found");
|
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({
|
const patternId = self.parseShading({
|
||||||
shading,
|
shading,
|
||||||
|
|||||||
1
test/pdfs/issue18765.pdf.link
Normal file
1
test/pdfs/issue18765.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://github.com/user-attachments/files/17065251/LUCID.-.Asif.Rasha-1.pdf
|
||||||
@ -3021,6 +3021,16 @@
|
|||||||
"lastPage": 1,
|
"lastPage": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "issue18765",
|
||||||
|
"file": "pdfs/issue18765.pdf",
|
||||||
|
"md5": "7763ead2aa69db3a5263f92bb1922e31",
|
||||||
|
"link": true,
|
||||||
|
"talos": false,
|
||||||
|
"rounds": 1,
|
||||||
|
"lastPage": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "issue11139",
|
"id": "issue11139",
|
||||||
"file": "pdfs/issue11139.pdf",
|
"file": "pdfs/issue11139.pdf",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user