diff options
author | hdu <duerr@sun.com> | 2009-10-13 15:58:01 +0200 |
---|---|---|
committer | hdu <duerr@sun.com> | 2009-10-13 15:58:01 +0200 |
commit | 280df82edc59bc802dcb9615d98090002ddfeed6 (patch) | |
tree | c5af8a430041c6dffd13e70308c009a408e35541 /vcl | |
parent | a5ea4e4b8f9eaa27805204067a4d3deed178f21c (diff) |
#i92671# fix parsing of GSUB.cov2 subtables (thanks cmc!)
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/fontsubset/gsub.cxx | 8 | ||||
-rw-r--r-- | vcl/source/glyphs/gcach_ftyp.cxx | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx index 9715e7fc8585..600c03194210 100644 --- a/vcl/source/fontsubset/gsub.cxx +++ b/vcl/source/fontsubset/gsub.cxx @@ -32,6 +32,8 @@ #include "gsub.h" +#include <osl/diagnose.h> + #include <vector> #include <map> #include <algorithm> @@ -280,9 +282,11 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile, { const USHORT nGlyph0 = NEXT_UShort( pCoverage ); const USHORT nGlyph1 = NEXT_UShort( pCoverage ); - const USHORT nCovIdx = NEXT_UShort( pCoverage ); + const USHORT nStartCoverageIndex = NEXT_UShort( pCoverage ); + OSL_ENSURE( aSubstVector.size() == nStartCoverageIndex, "coverage index mismatch"); + (void)nStartCoverageIndex; for( USHORT j = nGlyph0; j <= nGlyph1; ++j ) - aSubstVector.push_back( GlyphSubst( j + nCovIdx, 0 ) ); + aSubstVector.push_back( GlyphSubst( j, 0 ) ); } } break; diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index 712c2334b35c..86feb0d31dae 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -2487,10 +2487,12 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD ) { const USHORT nGlyph0 = GetUShort( pCoverage+0 ); const USHORT nGlyph1 = GetUShort( pCoverage+2 ); - const USHORT nCovIdx = GetUShort( pCoverage+4 ); + const USHORT nStartCoverageIndex = GetUShort( pCoverage+4 ); + DBG_ASSERT( aSubstVector.size() == nStartCoverageIndex, "coverage index mismatch"); + (void)nStartCoverageIndex; pCoverage += 6; for( USHORT j = nGlyph0; j <= nGlyph1; ++j ) - aSubstVector.push_back( GlyphSubst( j + nCovIdx, 0 ) ); + aSubstVector.push_back( GlyphSubst( j, 0 ) ); } } break; |