Add a boundary check before accessing the table of 'Index to Location'
authorJun Fang <jun_fang@foxitsoftware.com>
Tue, 16 Sep 2014 04:50:59 +0000 (21:50 -0700)
committerJun Fang <jun_fang@foxitsoftware.com>
Tue, 16 Sep 2014 04:50:59 +0000 (21:50 -0700)
commit4481496892d3d9555556df54edd6f98e9f63645e
tree042acb7e85bd22461b39fe0828026bd2b68c6457
parent4cce875b219ea772da8d528287b0e6431dcda48e
Add a boundary check before accessing the table of 'Index to Location'

Before this fix, only |gindex < face->num_locations| is checked. However, the pointer, p, will be moved to next location in the first FT_NEXT_ULONG or FT_NEXT_USHORT. It may cause a crashier. So a boundary check is needed before the second FT_NEXT_ULONG or FT_NEXT_USHORT.

BUG=412457
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/571833002
core/src/fxge/fx_freetype/fxft2.5.01/src/truetype/ttpload.c