Prevent XRef errors from breaking font loading (bug 1898802)
Note that the referenced file is trivially corrupt, since it contains *two* PDF documents placed in the same file which doesn't make sense (and isn't how a PDF document should be updated). However it's still a good idea to ensure that `loadFont` is able to handle errors when resolving References, since that allows us to invoke the existing fallback font handling.
This commit is contained in:
parent
18a7bd60f7
commit
cfcb700ecc
@ -1261,7 +1261,11 @@ class PartialEvaluator {
|
|||||||
return this.fontCache.get(fontRef);
|
return this.fontCache.get(fontRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
font = this.xref.fetchIfRef(fontRef);
|
try {
|
||||||
|
font = this.xref.fetchIfRef(fontRef);
|
||||||
|
} catch (ex) {
|
||||||
|
warn(`loadFont - lookup failed: "${ex}".`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(font instanceof Dict)) {
|
if (!(font instanceof Dict)) {
|
||||||
|
|||||||
1
test/pdfs/bug1898802.pdf.link
Normal file
1
test/pdfs/bug1898802.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://bugzilla.mozilla.org/attachment.cgi?id=9403877
|
||||||
@ -5447,6 +5447,15 @@
|
|||||||
"lastPage": 1,
|
"lastPage": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "bug1898802",
|
||||||
|
"file": "pdfs/bug1898802.pdf",
|
||||||
|
"md5": "65c3af306253faa8967982812aff523e",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": true,
|
||||||
|
"lastPage": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "issue4890",
|
"id": "issue4890",
|
||||||
"file": "pdfs/issue4890.pdf",
|
"file": "pdfs/issue4890.pdf",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user