summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-04 20:24:26 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-07-04 20:24:26 +0100
commit4999ebf208c5626ecb72fa6b2da11610268d8ad0 (patch)
tree4ce7db2a7c952ad169a7bbca11b4ed0714af8e69
parentba59a17f7caa5f02828b89b54df63fcc5b580fd4 (diff)
coverity#1213369 Untrusted value as argument
Change-Id: I3560bc689b2ffd44662678b62e18ce047efb22cc
-rw-r--r--vcl/source/fontsubset/sft.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 999a697c0276..60eda6437bec 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -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)));