summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2019-06-19 15:06:40 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2019-06-20 08:33:30 +0000
commit73ecd39debe850c11293fcf175c1e2b637edc5f3 (patch)
treef737f65a073c46549be8c5822284801d8f3b1b87
parenta05eb132416fcce8eb6a9fb240d0867796ed9deb (diff)
downloadqttools-73ecd39debe850c11293fcf175c1e2b637edc5f3.tar.gz
distancefieldgenerator: Fix failure reading CMAP for some fonts
If all the range offsets in the type 4 subtable in CMAP is equal to 0, there is no need for a glyph ID array, so this array can actually have zero length. We did not account for this, and would fail to read those fonts. Task-number: QTBUG-76188 Change-Id: I11873fba7214d179af1fcd7ccff9a9fd1c72ce10 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/distancefieldgenerator/distancefieldmodelworker.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/distancefieldgenerator/distancefieldmodelworker.cpp b/src/distancefieldgenerator/distancefieldmodelworker.cpp
index d140ff219..b76f3b707 100644
--- a/src/distancefieldgenerator/distancefieldmodelworker.cpp
+++ b/src/distancefieldgenerator/distancefieldmodelworker.cpp
@@ -148,7 +148,7 @@ void DistanceFieldModelWorker::readCmapSubtable(const CmapSubtable4 *subtable, c
const qint16 *idDeltas = reinterpret_cast<const qint16 *>(startCodes + segCount);
const quint16 *idRangeOffsets = reinterpret_cast<const quint16 *>(idDeltas + segCount);
const quint16 *glyphIdArray = idRangeOffsets + segCount;
- if (glyphIdArray >= end) {
+ if (glyphIdArray > end) {
emit error(tr("End of cmap table reached when parsing subtable format '4'"));
return;
}