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

Merge pull request #14111 from Snuffleupagus/bug-1734802

Take the /CIDToGIDMap data into account when computing the hash, in `PartialEvaluator.preEvaluateFont`, for composite fonts (bug 1734802)
This commit is contained in:
Tim van der Meij 2021-10-09 14:25:25 +02:00 committed by GitHub
commit 63370ff12f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View file

@ -81,6 +81,7 @@ import {
LocalTilingPatternCache,
} from "./image_utils.js";
import { NullStream, Stream } from "./stream.js";
import { BaseStream } from "./base_stream.js";
import { bidi } from "./bidi.js";
import { ColorSpace } from "./colorspace.js";
import { DecodeStream } from "./decode_stream.js";
@ -3139,7 +3140,7 @@ class PartialEvaluator {
}
const cidToGidMap = dict.get("CIDToGIDMap");
if (isStream(cidToGidMap)) {
if (cidToGidMap instanceof BaseStream) {
cidToGidBytes = cidToGidMap.getBytes();
}
}
@ -3790,6 +3791,16 @@ class PartialEvaluator {
}
hash.update(widthsBuf.join());
}
const cidToGidMap =
dict.getRaw("CIDToGIDMap") || baseDict.getRaw("CIDToGIDMap");
if (cidToGidMap instanceof Name) {
hash.update(cidToGidMap.name);
} else if (cidToGidMap instanceof Ref) {
hash.update(cidToGidMap.toString());
} else if (cidToGidMap instanceof BaseStream) {
hash.update(cidToGidMap.peekBytes());
}
}
}

View file

@ -0,0 +1 @@
https://bugzilla.mozilla.org/attachment.cgi?id=9244936

View file

@ -166,6 +166,14 @@
"rounds": 1,
"type": "eq"
},
{ "id": "bug1734802",
"file": "pdfs/bug1734802.pdf",
"md5": "a23ad8af95ffca3876e110a5f4dec9bc",
"rounds": 1,
"link": true,
"lastPage": 3,
"type": "eq"
},
{ "id": "bug921760",
"file": "pdfs/bug921760.pdf",
"md5": "1aa136d786a65b0d7cce7bdb3c58c6c3",