freetype: fix overflow when converting from a uint16 glyph index to a
file offset. R=bradfitz CC=golang-dev http://codereview.appspot.com/6198043
This commit is contained in:
parent
1dee26bbb2
commit
d32ba0b88b
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user