1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Fix OTS issue with empty index (#15289)

This commit is contained in:
Calixte Denizet 2022-08-08 22:04:14 +02:00
parent 40f9f7e909
commit 04f78c935c
3 changed files with 13 additions and 3 deletions

View file

@ -1864,10 +1864,9 @@ class CFFCompiler {
// First 2 bytes contains the number of objects contained into this index
const count = objects.length;
// If there is no object, just create an index. This technically
// should just be [0, 0] but OTS has an issue with that.
// If there is no object, just create an index.
if (count === 0) {
return [0, 0, 0];
return [0, 0];
}
const data = [(count >> 8) & 0xff, count & 0xff];