mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 23:58:07 +02:00
Merge pull request #12964 from calixteman/12963
Avoid infinite loop when getting annotation field name
This commit is contained in:
commit
bab059d8fd
6 changed files with 39 additions and 36 deletions
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -76,6 +76,7 @@
|
|||
!issue8798r.pdf
|
||||
!issue8823.pdf
|
||||
!issue9084.pdf
|
||||
!issue12963.pdf
|
||||
!issue9105_reduced.pdf
|
||||
!issue9252.pdf
|
||||
!issue9262_reduced.pdf
|
||||
|
|
BIN
test/pdfs/issue12963.pdf
Normal file
BIN
test/pdfs/issue12963.pdf
Normal file
Binary file not shown.
|
@ -2445,6 +2445,15 @@
|
|||
"lastPage": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue12963",
|
||||
"file": "pdfs/issue12963.pdf",
|
||||
"md5": "2590047a2ef0113e698d888c29918008",
|
||||
"rounds": 1,
|
||||
"firstPage": 1,
|
||||
"lastPage": 1,
|
||||
"type": "eq",
|
||||
"annotations": true
|
||||
},
|
||||
{ "id": "multiple-filters-length-zero",
|
||||
"file": "pdfs/multiple-filters-length-zero.pdf",
|
||||
"md5": "c273c3a6fb79cbf3034fe1b62b204728",
|
||||
|
|
|
@ -123,30 +123,6 @@ describe("core_utils", function () {
|
|||
["qux2", "quux"],
|
||||
]);
|
||||
});
|
||||
|
||||
it("stops searching when the loop limit is reached", function () {
|
||||
const dict = new Dict();
|
||||
let currentDict = dict;
|
||||
let parentDict = null;
|
||||
// Exceed the loop limit of 100.
|
||||
for (let i = 0; i < 150; i++) {
|
||||
parentDict = new Dict();
|
||||
currentDict.set("Parent", parentDict);
|
||||
currentDict = parentDict;
|
||||
}
|
||||
parentDict.set("foo", "bar"); // Never found because of loop limit.
|
||||
expect(getInheritableProperty({ dict, key: "foo" })).toEqual(undefined);
|
||||
|
||||
dict.set("foo", "baz");
|
||||
expect(
|
||||
getInheritableProperty({
|
||||
dict,
|
||||
key: "foo",
|
||||
getArray: false,
|
||||
stopWhenFound: false,
|
||||
})
|
||||
).toEqual(["baz"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("toRomanNumerals", function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue