diff options
author | Jungshik Shin <jungshik@google.com> | 2017-04-15 23:00:23 -0700 |
---|---|---|
committer | Jungshik Shin <jungshik@google.com> | 2017-04-15 23:00:23 -0700 |
commit | 2357eb4d408bd48fb7ad5641c6967f4d50ecc4a8 (patch) | |
tree | 81eff1bb13c64ab12a060173ad2673ad7733e241 | |
parent | 9f89d8b7f271e32475af103a5c7763d87c23d756 (diff) | |
download | freetype-2357eb4d408bd48fb7ad5641c6967f4d50ecc4a8.tar.gz |
Cherry-pick HVAR/VVAR fix from the upstream
Cherry pick the following from the upstream:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=da38be8
This is to fix https://savannah.nongnu.org/bugs/index.php?50678
BUG: 36792206
Test: manual
Change-Id: Icf356d643b86a56b14c26f2a340a4a7b92925813
-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 { |