diff options
author | Pale Moon <git-repo@palemoon.org> | 2016-10-15 13:45:20 +0200 |
---|---|---|
committer | Pale Moon <git-repo@palemoon.org> | 2016-10-15 13:45:20 +0200 |
commit | 533f8f179e3dffc3388a520994914ba6aa21e27d (patch) | |
tree | de59245560ebd10c82de63effc3cfc3f2b3e43b4 /gfx | |
parent | a04ff14ceda5eb25907e5945951e4adcdb6db86b (diff) | |
download | palemoon-gre-533f8f179e3dffc3388a520994914ba6aa21e27d.tar.gz |
Update OTS to 5.1.0 + fix missing OTS_API visibility.
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/ots/README.mcp | 4 | ||||
-rw-r--r-- | gfx/ots/include/opentype-sanitiser.h | 4 | ||||
-rw-r--r-- | gfx/ots/src/ots.cc | 11 |
3 files changed, 11 insertions, 8 deletions
diff --git a/gfx/ots/README.mcp b/gfx/ots/README.mcp index 1fee451b9..0d74d4ec5 100644 --- a/gfx/ots/README.mcp +++ b/gfx/ots/README.mcp @@ -2,8 +2,8 @@ This is the Sanitiser for OpenType project, from http://code.google.com/p/ots/. Our reference repository is https://github.com/khaledhosny/ots/. -Current version derived from upstream release: version 5.0.1 -Commit used: 8d70cffebbfa58f67a5c3ed0e9bc84dccdbc5bc0 +Current version derived from upstream release: version 5.1.0 +Commit used: 5d82ccd35fa61f605a43a5433625e379ca0f4018 Upstream files included: LICENSE, src/, include/ diff --git a/gfx/ots/include/opentype-sanitiser.h b/gfx/ots/include/opentype-sanitiser.h index 482fb3447..87d0f3d28 100644 --- a/gfx/ots/include/opentype-sanitiser.h +++ b/gfx/ots/include/opentype-sanitiser.h @@ -44,6 +44,8 @@ typedef unsigned __int64 uint64_t; #include <stdint.h> #endif +#include <sys/types.h> + #include <algorithm> #include <cassert> #include <cstddef> @@ -179,7 +181,7 @@ enum TableAction { TABLE_ACTION_DROP // Drop the table }; -class OTSContext { +class OTS_API OTSContext { public: OTSContext() {} virtual ~OTSContext() {} diff --git a/gfx/ots/src/ots.cc b/gfx/ots/src/ots.cc index 8a3a9a0eb..15794475a 100644 --- a/gfx/ots/src/ots.cc +++ b/gfx/ots/src/ots.cc @@ -478,17 +478,18 @@ bool ProcessWOFF2(ots::OpenTypeFile *header, return OTS_FAILURE_MSG_HDR("Size of decompressed WOFF 2.0 font exceeds 30MB"); } - std::vector<uint8_t> decompressed_buffer(decompressed_size); - if (!woff2::ConvertWOFF2ToTTF(&decompressed_buffer[0], decompressed_size, - data, length)) { + std::string buf(decompressed_size, 0); + woff2::WOFF2StringOut out(&buf); + if (!woff2::ConvertWOFF2ToTTF(data, length, &out)) { return OTS_FAILURE_MSG_HDR("Failed to convert WOFF 2.0 font to SFNT"); } + const uint8_t *decompressed = reinterpret_cast<const uint8_t*>(buf.data()); if (data[4] == 't' && data[5] == 't' && data[6] == 'c' && data[7] == 'f') { - return ProcessTTC(header, output, &decompressed_buffer[0], decompressed_size, index); + return ProcessTTC(header, output, decompressed, out.Size(), index); } else { ots::Font font(header); - return ProcessTTF(header, &font, output, &decompressed_buffer[0], decompressed_size); + return ProcessTTF(header, &font, output, decompressed, out.Size()); } } |