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:
commit
ea2172e754
3 changed files with 30 additions and 7 deletions
|
@ -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,
|
||||
|
|
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,
|
||||
"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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue