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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user