diff options
author | Jungshik Shin <jungshik@google.com> | 2017-04-17 22:32:48 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-04-17 22:32:48 +0000 |
commit | 64a7307ce23cab730902cc9bb8def373d0ef4e9a (patch) | |
tree | 81eff1bb13c64ab12a060173ad2673ad7733e241 | |
parent | 46879d6863795c91098407bf4a1603a4634daaa1 (diff) | |
parent | 2357eb4d408bd48fb7ad5641c6967f4d50ecc4a8 (diff) | |
download | freetype-64a7307ce23cab730902cc9bb8def373d0ef4e9a.tar.gz |
Cherry-pick HVAR/VVAR fix from the upstream
am: 2357eb4d40
Change-Id: Iec2fe854e78fa4216b452b9c3de4e93a2db09da1
-rw-r--r-- | README.android | 7 | ||||
-rw-r--r-- | src/truetype/ttgxvar.c | 15 |
2 files changed, 14 insertions, 8 deletions
diff --git a/README.android b/README.android index 3f599a05b..d7c45fa29 100644 --- a/README.android +++ b/README.android @@ -19,3 +19,10 @@ The following options are disabled in include/freetype/config/ftoption.h: The following option is enabled to support color fonts. FT_CONFIG_OPTION_USE_PNG + +The following commit is cherry-picked from the upstream: +( http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=da38be8 ) + + author Werner Lemberg <wl@gnu.org> 2017-03-30 13:24:03 +0200 + commit da38be831d2c8ea5443c73d01ecfbc750bba7045 (patch) + [truetype] Fix HVAR and VVAR handling (#50678). diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index 0168120d9..d6c293107 100644 --- a/src/truetype/ttgxvar.c +++ b/src/truetype/ttgxvar.c @@ -1006,16 +1006,15 @@ if ( table->widthMap.innerIndex ) { - if ( gindex >= table->widthMap.mapCount ) - { - FT_TRACE2(( "gindex %d out of range\n", gindex )); - error = FT_THROW( Invalid_Argument ); - goto Exit; - } + FT_UInt idx = gindex; + + + if ( idx >= table->widthMap.mapCount ) + idx = table->widthMap.mapCount - 1; /* trust that HVAR parser has checked indices */ - outerIndex = table->widthMap.outerIndex[gindex]; - innerIndex = table->widthMap.innerIndex[gindex]; + outerIndex = table->widthMap.outerIndex[idx]; + innerIndex = table->widthMap.innerIndex[idx]; } else { |