summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2019-09-21 08:32:02 +0000
committerTavmjong Bah <tavmjong@free.fr>2019-09-21 08:32:02 +0000
commitebe98834792584fd8c1d0fee58379debe0afbede (patch)
tree1c45b8ecb3e2aa2a9157796b1daea85017533fb6 /src/libnrtype
parentMake sure all conditions reached (minor touchup) (diff)
downloadinkscape-ebe98834792584fd8c1d0fee58379debe0afbede.tar.gz
inkscape-ebe98834792584fd8c1d0fee58379debe0afbede.zip
Fix segfault when reading Bixia SVG in OpenType font.
Fixes https://gitlab.com/inkscape/inbox/issues/845
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/OpenTypeUtil.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libnrtype/OpenTypeUtil.cpp b/src/libnrtype/OpenTypeUtil.cpp
index 2b60cca9e..f9a148c3a 100644
--- a/src/libnrtype/OpenTypeUtil.cpp
+++ b/src/libnrtype/OpenTypeUtil.cpp
@@ -366,7 +366,7 @@ void readOpenTypeSVGTable(const FT_Face ft_face,
// std::cout << "Offset: " << offset << std::endl;
// Bytes 6-9 are reserved.
- uint16_t entries = (data[offset] << 8) + data[offset+1];
+ uint16_t entries = ((data[offset] & 0xff) << 8) + (data[offset+1] & 0xff);
// std::cout << "Number of entries: " << entries << std::endl;
for (int entry = 0; entry < entries; ++entry) {