diff options
author | Werner Lemberg <wl@gnu.org> | 2017-01-01 10:43:41 +0100 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2017-01-01 10:43:41 +0100 |
commit | 63765a8f2af9d379f5571c359fb7133b35878924 (patch) | |
tree | e715651f5773aea03ec148c9b012b2a3e4be05ec /src/sfnt/sfobjs.c | |
parent | 24be60b5f160d9aad7366bf3043ec8069664df0b (diff) | |
download | freetype2-63765a8f2af9d379f5571c359fb7133b35878924.tar.gz |
[sfnt] Return correct number of named instances for TTCs.
Without this patch, requesting information for face index N returned
the data for face index N+1 (or index 0).
* src/sfnt/sfobjs.c (sfnt_init_face): Correctly adjust `face_index'
for negative `face_instance_index' values.
Diffstat (limited to 'src/sfnt/sfobjs.c')
-rw-r--r-- | src/sfnt/sfobjs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 818009ef5..5e7380bae 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -909,6 +909,10 @@ face_index = FT_ABS( face_instance_index ) & 0xFFFF; + /* value -(N+1) requests information on index N */ + if ( face_instance_index < 0 ) + face_index--; + if ( face_index >= face->ttc_header.count ) { if ( face_instance_index >= 0 ) |