Cleanup ContextFormat3 sanitize

This commit is contained in:
Behdad Esfahbod 2010-04-22 13:37:58 -04:00
parent e77302c61f
commit 9fc8684fd8
1 changed files with 3 additions and 2 deletions

View File

@ -463,10 +463,11 @@ struct ContextFormat3
TRACE_SANITIZE (); TRACE_SANITIZE ();
if (!SANITIZE_SELF ()) return false; if (!SANITIZE_SELF ()) return false;
unsigned int count = glyphCount; unsigned int count = glyphCount;
if (!SANITIZE_ARRAY (coverage, OffsetTo<Coverage>::get_size (), glyphCount)) return false;
for (unsigned int i = 0; i < count; i++) for (unsigned int i = 0; i < count; i++)
if (!SANITIZE_THIS (coverage[i])) return false; if (!SANITIZE_THIS (coverage[i])) return false;
LookupRecord *lookupRecord = &CAST(LookupRecord, coverage, coverage[0].get_size () * glyphCount); LookupRecord *lookupRecord = &CAST(LookupRecord, coverage, OffsetTo<Coverage>::get_size () * glyphCount);
return SANITIZE_MEM (lookupRecord, lookupRecord[0].get_size () * lookupCount); return SANITIZE_ARRAY (lookupRecord, LookupRecord::get_size (), lookupCount);
} }
private: private: