提交 d32ba0b8 编写于 作者: N Nigel Tao

freetype: fix overflow when converting from a uint16 glyph index to a

file offset.

R=bradfitz
CC=golang-dev
http://codereview.appspot.com/6198043
上级 1dee26bb
......@@ -568,11 +568,11 @@ func (g *GlyphBuf) load(f *Font, i Index, recursion int) error {
// Find the relevant slice of f.glyf.
var g0, g1 uint32
if f.locaOffsetFormat == locaOffsetFormatShort {
d := data(f.loca[2*i:])
d := data(f.loca[2*int(i):])
g0 = 2 * uint32(d.u16())
g1 = 2 * uint32(d.u16())
} else {
d := data(f.loca[4*i:])
d := data(f.loca[4*int(i):])
g0 = d.u32()
g1 = d.u32()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册