提交 b64ef69b 编写于 作者: M Michiharu Ariza

from encode_int removed assert hit by fuzzer

clamp the value instead
上级 fc0153a1
......@@ -59,7 +59,10 @@ struct ByteStrBuff : hb_vector_t<char, 1>
return encode_byte ((v >> 8) + OpCode_TwoByteNegInt0) && encode_byte (v & 0xFF);
}
}
assert ((-32768 <= v) && (v <= 32767));
if (unlikely (v < -32768))
v = -32768;
else if (unlikely (v > 32767))
v = 32767;
return encode_byte (OpCode_shortint) &&
encode_byte ((v >> 8) & 0xFF) &&
encode_byte (v & 0xFF);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册