Kaydet (Commit) 4999ebf2 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1213369 Untrusted value as argument

Change-Id: I3560bc689b2ffd44662678b62e18ce047efb22cc
üst ba59a17f
......@@ -1721,7 +1721,7 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
for( i = 0; i <= (int)t->nglyphs; ++i )
t->goffsets[i] = indexfmt ? GetUInt32(table, i << 2, 1) : (sal_uInt32)GetUInt16(table, i << 1, 1) << 1;
} else if( getTable(t, O_CFF) ) { /* PS-OpenType */
int k = getTableSize(t, O_CFF); /* set a limit here, presumably much lower than the table size, but establishes some sort of physical bound */
int k = (getTableSize(t, O_CFF) / 2) - 1; /* set a limit here, presumably much lower than the table size, but establishes some sort of physical bound */
if( k < (int)t->nglyphs )
t->nglyphs = k;
t->goffsets = static_cast<sal_uInt32 *>(calloc(1+t->nglyphs, sizeof(sal_uInt32)));
......
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