fix max range of instructions

This commit is contained in:
kekee000 2015-03-04 16:11:00 +08:00
parent 468d0cbdcc
commit 757c0cafda

View File

@ -183,11 +183,14 @@ define(
// instructions
length = reader.readUint16();
if (length) {
instructions = [];
for (i = 0; i < length; ++i) {
instructions.push(reader.readUint8());
// range错误
if (length < 1000) {
instructions = [];
for (i = 0; i < length; ++i) {
instructions.push(reader.readUint8());
}
glyf.instructions = instructions;
}
glyf.instructions = instructions;
}
readSimpleGlyf.call(