diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-01 14:33:10 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-01 14:33:10 +0200 |
commit | bad62e9a44f446eb78de3d4368d1385a58156797 (patch) | |
tree | 4090ec90837d77bfbf6ca71b2d7f4a15d319a4bd /gfx/thebes/gfxHarfBuzzShaper.cpp | |
parent | ca3a3b63eed0de7d86291dab8479dcc3e4fc4b8f (diff) | |
download | UXP-bad62e9a44f446eb78de3d4368d1385a58156797.tar UXP-bad62e9a44f446eb78de3d4368d1385a58156797.tar.gz UXP-bad62e9a44f446eb78de3d4368d1385a58156797.tar.lz UXP-bad62e9a44f446eb78de3d4368d1385a58156797.tar.xz UXP-bad62e9a44f446eb78de3d4368d1385a58156797.zip |
Rework gfxFontUtils::MapCharToGlyphFormat4 to be more robust. DiD
Diffstat (limited to 'gfx/thebes/gfxHarfBuzzShaper.cpp')
-rw-r--r-- | gfx/thebes/gfxHarfBuzzShaper.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp index 4b9dbbc14..f2264bc1f 100644 --- a/gfx/thebes/gfxHarfBuzzShaper.cpp +++ b/gfx/thebes/gfxHarfBuzzShaper.cpp @@ -111,13 +111,15 @@ gfxHarfBuzzShaper::GetNominalGlyph(hb_codepoint_t unicode) const NS_ASSERTION(mCmapTable && (mCmapFormat > 0) && (mSubtableOffset > 0), "cmap data not correctly set up, expect disaster"); + uint32_t length; const uint8_t* data = - (const uint8_t*)hb_blob_get_data(mCmapTable, nullptr); + (const uint8_t*)hb_blob_get_data(mCmapTable, &length); switch (mCmapFormat) { case 4: gid = unicode < UNICODE_BMP_LIMIT ? gfxFontUtils::MapCharToGlyphFormat4(data + mSubtableOffset, + length - mSubtableOffset, unicode) : 0; break; case 10: @@ -157,8 +159,9 @@ gfxHarfBuzzShaper::GetVariationGlyph(hb_codepoint_t unicode, NS_ASSERTION(mCmapTable && (mCmapFormat > 0) && (mSubtableOffset > 0), "cmap data not correctly set up, expect disaster"); + uint32_t length; const uint8_t* data = - (const uint8_t*)hb_blob_get_data(mCmapTable, nullptr); + (const uint8_t*)hb_blob_get_data(mCmapTable, &length); if (mUVSTableOffset) { hb_codepoint_t gid = @@ -176,6 +179,7 @@ gfxHarfBuzzShaper::GetVariationGlyph(hb_codepoint_t unicode, case 4: if (compat < UNICODE_BMP_LIMIT) { return gfxFontUtils::MapCharToGlyphFormat4(data + mSubtableOffset, + length - mSubtableOffset, compat); } break; |