Skip to content

Commit

Permalink
PDFBOX-5733: assign extensionLookupType to lookupType and check that …
Browse files Browse the repository at this point in the history
…they remain the same

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1914537 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Dec 11, 2023
1 parent 5e468b4 commit 924dabe
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,16 @@ private LookupTable readLookupTable(TTFDataStream data, long offset) throws IOEx
long baseOffset = data.getCurrentPosition();
int substFormat = data.readUnsignedShort(); // always 1
int extensionLookupType = data.readUnsignedShort();
if (lookupType != 7 && lookupType != extensionLookupType)
{
// "If a lookup table uses extension subtables, then all of the extension
// subtables must have the same extensionLookupType"
LOG.error("extensionLookupType changed from {} to {}",
lookupType, extensionLookupType);
data.seek(baseOffset + 8);
continue;
}
lookupType = extensionLookupType;
long extensionOffset = data.readUnsignedInt();
if (substFormat != 1)
{
Expand Down

0 comments on commit 924dabe

Please sign in to comment.