Kaydet (Commit) dc8a20fb authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

stay within font bounds

Change-Id: Ie8ed610b71cb1b20963827c2be97155d2d8aa22c
Reviewed-on: https://gerrit.libreoffice.org/49371Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
(cherry picked from commit 358808ae)
üst caa1c9e3
...@@ -1577,7 +1577,12 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t ) ...@@ -1577,7 +1577,12 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
/* parse the tables */ /* parse the tables */
for (i=0; i<(int)t->ntables; i++) { for (i=0; i<(int)t->ntables; i++) {
int nIndex; int nIndex;
tag = GetUInt32(t->ptr + tdoffset + 12, 16 * i); const sal_uInt32 nStart = tdoffset + 12;
const sal_uInt32 nOffset = 16 * i;
if (nStart + nOffset + sizeof(sal_uInt32) <= static_cast<sal_uInt32>(t->fsize))
tag = GetUInt32(t->ptr + nStart, nOffset);
else
tag = static_cast<sal_uInt32>(-1);
switch( tag ) { switch( tag ) {
case T_maxp: nIndex = O_maxp; break; case T_maxp: nIndex = O_maxp; break;
case T_glyf: nIndex = O_glyf; break; case T_glyf: nIndex = O_glyf; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment