Skip to content

Commit 589f72e

Browse files
authored
Merge pull request #15290 from calixteman/ots_issue
Fix OTS issue with empty index (#15289)
2 parents 40f9f7e + 04f78c9 commit 589f72e

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/core/cff_parser.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,10 +1864,9 @@ class CFFCompiler {
18641864
// First 2 bytes contains the number of objects contained into this index
18651865
const count = objects.length;
18661866

1867-
// If there is no object, just create an index. This technically
1868-
// should just be [0, 0] but OTS has an issue with that.
1867+
// If there is no object, just create an index.
18691868
if (count === 0) {
1870-
return [0, 0, 0];
1869+
return [0, 0];
18711870
}
18721871

18731872
const data = [(count >> 8) & 0xff, count & 0xff];

test/pdfs/issue15289.pdf.link

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://github.com/mozilla/pdf.js/files/9280755/issue15289.pdf
2+

test/test_manifest.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6882,5 +6882,14 @@
68826882
"md5": "8505033d63625dfd77e90a3722b0c316",
68836883
"rounds": 1,
68846884
"type": "eq"
6885+
},
6886+
{ "id": "issue15289",
6887+
"file": "pdfs/issue15289.pdf",
6888+
"md5": "f3d20aee398e052ac3dce7cc030f50de",
6889+
"link": true,
6890+
"rounds": 1,
6891+
"firstPage": 1,
6892+
"lastPage": 1,
6893+
"type": "eq"
68856894
}
68866895
]

0 commit comments

Comments
 (0)