1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Ensure that the /P-entry is actually a dictionary in StructTreePage.prototype.addNode

This may fix issue 19822, but without a test-case it's simply impossible to know for sure.
This commit is contained in:
Jonas Jenwald 2025-04-17 14:01:53 +02:00
parent 76f23ce3b5
commit bf553f22da

View file

@ -757,7 +757,10 @@ class StructTreePage {
const parent = dict.get("P");
if (!parent || isName(parent.get("Type"), "StructTreeRoot")) {
if (
!(parent instanceof Dict) ||
isName(parent.get("Type"), "StructTreeRoot")
) {
if (!this.addTopLevelNode(dict, element)) {
map.delete(dict);
}