[COLR] Revert previous sanitization on the table
That sanitization wasn't right, firstLayerIndex is an index from beginning of the Layer Records not the table itself.
This commit is contained in:
parent
71b4598ea3
commit
432758a7ac
|
@ -53,17 +53,14 @@ struct LayerRecord
|
||||||
|
|
||||||
struct BaseGlyphRecord
|
struct BaseGlyphRecord
|
||||||
{
|
{
|
||||||
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
|
inline bool sanitize (hb_sanitize_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_SANITIZE (this);
|
TRACE_SANITIZE (this);
|
||||||
return_trace (c->check_struct (this) &&
|
return_trace (c->check_struct (this));
|
||||||
firstLayerIndex.sanitize (c, base) &&
|
|
||||||
c->check_array ((const void*) &firstLayerIndex, sizeof (LayerRecord), numLayers));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GlyphID gID; /* Glyph ID of reference glyph */
|
GlyphID gID; /* Glyph ID of reference glyph */
|
||||||
OffsetTo<LayerRecord>
|
HBUINT16 firstLayerIndex; /* Index to the layer record */
|
||||||
firstLayerIndex; /* Index to the layer record */
|
|
||||||
HBUINT16 numLayers; /* Number of color layers associated with this glyph */
|
HBUINT16 numLayers; /* Number of color layers associated with this glyph */
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (6);
|
DEFINE_SIZE_STATIC (6);
|
||||||
|
@ -76,17 +73,9 @@ struct COLR
|
||||||
inline bool sanitize (hb_sanitize_context_t *c) const
|
inline bool sanitize (hb_sanitize_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_SANITIZE (this);
|
TRACE_SANITIZE (this);
|
||||||
if (!(c->check_struct (this) &&
|
return_trace (c->check_struct (this) &&
|
||||||
c->check_array ((const void*) &baseGlyphRecords, sizeof (BaseGlyphRecord), numBaseGlyphRecords) &&
|
c->check_array ((const void*) &layerRecordsOffset, sizeof (LayerRecord), numLayerRecords) &&
|
||||||
c->check_array ((const void*) &layerRecordsOffset, sizeof (LayerRecord), numLayerRecords)))
|
c->check_array ((const void*) &baseGlyphRecords, sizeof (BaseGlyphRecord), numBaseGlyphRecords));
|
||||||
return_trace (false);
|
|
||||||
|
|
||||||
const BaseGlyphRecord *base_glyph_records = &baseGlyphRecords (this);
|
|
||||||
for (unsigned int i = 0; i < numBaseGlyphRecords; ++i)
|
|
||||||
if (!(base_glyph_records[i].sanitize (c, this)))
|
|
||||||
return_trace (false);
|
|
||||||
|
|
||||||
return_trace (true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in New Issue