Kaydet (Commit) 5a89092d authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1222238 Untrusted loop bound

Change-Id: I1a4dec8727d0a27f7fd0396fd22d955f61daaee4
üst 38a1f24c
...@@ -2045,6 +2045,14 @@ static GlyphOffsets *GlyphOffsetsNew(sal_uInt8 *sfntP, sal_uInt32 sfntLen) ...@@ -2045,6 +2045,14 @@ static GlyphOffsets *GlyphOffsetsNew(sal_uInt8 *sfntP, sal_uInt32 sfntLen)
sal_uInt32 locaLen = 0; sal_uInt32 locaLen = 0;
sal_Int16 indexToLocFormat = 0; sal_Int16 indexToLocFormat = 0;
sal_uInt32 nMaxPossibleTables = sfntLen / (3*sizeof(sal_uInt32)); /*the three GetUInt32 calls*/
if (numTables > nMaxPossibleTables)
{
SAL_WARN( "vcl.fonts", "GlyphOffsetsNew claimed to have "
<< numTables << " tables, but that's impossibly large");
numTables = nMaxPossibleTables;
}
for (i = 0; i < numTables; i++) { for (i = 0; i < numTables; i++) {
sal_uInt32 nLargestFixedOffsetPos = 12 + 16 * i + 12; sal_uInt32 nLargestFixedOffsetPos = 12 + 16 * i + 12;
sal_uInt32 nMinSize = nLargestFixedOffsetPos + sizeof(sal_uInt32); sal_uInt32 nMinSize = nLargestFixedOffsetPos + 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