Remove SANITIZE_WITH_BASE
This commit is contained in:
parent
f5fab0c718
commit
41a93d2c1f
|
@ -127,7 +127,7 @@ struct TTCHeaderVersion1
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, table);
|
||||
return table.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -240,8 +240,6 @@ struct hb_sanitize_context_t
|
|||
|
||||
#define SANITIZE(X) likely ((X).sanitize (context))
|
||||
|
||||
#define SANITIZE_WITH_BASE(B,X) likely ((X).sanitize (context, CharP(B)))
|
||||
|
||||
#define SANITIZE_SELF() likely(context->check_range (this, sizeof (*this)))
|
||||
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ struct Record
|
|||
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (base, offset);
|
||||
&& offset.sanitize (context, base);
|
||||
}
|
||||
|
||||
Tag tag; /* 4-byte Tag identifier */
|
||||
|
@ -204,8 +204,8 @@ struct Script
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, defaultLangSys)
|
||||
&& SANITIZE_WITH_BASE (this, langSys);
|
||||
return defaultLangSys.sanitize (context, this)
|
||||
&& langSys.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -69,8 +69,8 @@ struct AttachList
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, attachPoint);
|
||||
return coverage.sanitize (context, this)
|
||||
&& attachPoint.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -149,7 +149,7 @@ struct CaretValueFormat3
|
|||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (this, deviceTable);
|
||||
&& deviceTable.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -214,7 +214,7 @@ struct LigGlyph
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, carets);
|
||||
return carets.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -246,8 +246,8 @@ struct LigCaretList
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, ligGlyph);
|
||||
return coverage.sanitize (context, this)
|
||||
&& ligGlyph.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -268,7 +268,7 @@ struct MarkGlyphSetsFormat1
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage);
|
||||
return coverage.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -352,11 +352,11 @@ struct GDEF
|
|||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE (version) && likely (version.major == 1)
|
||||
&& SANITIZE_WITH_BASE (this, glyphClassDef)
|
||||
&& SANITIZE_WITH_BASE (this, attachList)
|
||||
&& SANITIZE_WITH_BASE (this, ligCaretList)
|
||||
&& SANITIZE_WITH_BASE (this, markAttachClassDef)
|
||||
&& (version < 0x00010002 || SANITIZE_WITH_BASE (this, markGlyphSetsDef[0]));
|
||||
&& glyphClassDef.sanitize (context, this)
|
||||
&& attachList.sanitize (context, this)
|
||||
&& ligCaretList.sanitize (context, this)
|
||||
&& markAttachClassDef.sanitize (context, this)
|
||||
&& (version < 0x00010002 || markGlyphSetsDef[0].sanitize (context, this));
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2007,2008,2009 Red Hat, Inc.
|
||||
* Copyright (C) 2007,2008,2009,2010 Red Hat, Inc.
|
||||
*
|
||||
* This is part of HarfBuzz, a text shaping library.
|
||||
*
|
||||
|
@ -106,10 +106,10 @@ struct ValueFormat : USHORT
|
|||
x_scale = layout->font->x_scale;
|
||||
y_scale = layout->font->y_scale;
|
||||
/* design units -> fractional pixel */
|
||||
if (format & xPlacement) glyph_pos->x_offset += _hb_16dot16_mul_round (x_scale, *(SHORT*)values++);
|
||||
if (format & yPlacement) glyph_pos->y_offset += _hb_16dot16_mul_round (y_scale, *(SHORT*)values++);
|
||||
if (format & xAdvance) glyph_pos->x_advance += _hb_16dot16_mul_round (x_scale, *(SHORT*)values++);
|
||||
if (format & yAdvance) glyph_pos->y_advance += _hb_16dot16_mul_round (y_scale, *(SHORT*)values++);
|
||||
if (format & xPlacement) glyph_pos->x_offset += _hb_16dot16_mul_round (x_scale, *CastP<SHORT> (values++));
|
||||
if (format & yPlacement) glyph_pos->y_offset += _hb_16dot16_mul_round (y_scale, *CastP<SHORT> (values++));
|
||||
if (format & xAdvance) glyph_pos->x_advance += _hb_16dot16_mul_round (x_scale, *CastP<SHORT> (values++));
|
||||
if (format & yAdvance) glyph_pos->y_advance += _hb_16dot16_mul_round (y_scale, *CastP<SHORT> (values++));
|
||||
|
||||
if (!has_device ()) return;
|
||||
|
||||
|
@ -120,21 +120,21 @@ struct ValueFormat : USHORT
|
|||
|
||||
/* pixel -> fractional pixel */
|
||||
if (format & xPlaDevice) {
|
||||
if (x_ppem) glyph_pos->x_offset += (base+*(OffsetTo<Device>*)values++).get_delta (x_ppem) << 16; else values++;
|
||||
if (x_ppem) glyph_pos->x_offset += (base+*CastP<OffsetTo<Device> >(values++)).get_delta (x_ppem) << 16; else values++;
|
||||
}
|
||||
if (format & yPlaDevice) {
|
||||
if (y_ppem) glyph_pos->y_offset += (base+*(OffsetTo<Device>*)values++).get_delta (y_ppem) << 16; else values++;
|
||||
if (y_ppem) glyph_pos->y_offset += (base+*CastP<OffsetTo<Device> >(values++)).get_delta (y_ppem) << 16; else values++;
|
||||
}
|
||||
if (format & xAdvDevice) {
|
||||
if (x_ppem) glyph_pos->x_advance += (base+*(OffsetTo<Device>*)values++).get_delta (x_ppem) << 16; else values++;
|
||||
if (x_ppem) glyph_pos->x_advance += (base+*CastP<OffsetTo<Device> >(values++)).get_delta (x_ppem) << 16; else values++;
|
||||
}
|
||||
if (format & yAdvDevice) {
|
||||
if (y_ppem) glyph_pos->y_advance += (base+*(OffsetTo<Device>*)values++).get_delta (y_ppem) << 16; else values++;
|
||||
if (y_ppem) glyph_pos->y_advance += (base+*CastP<OffsetTo<Device> >(values++)).get_delta (y_ppem) << 16; else values++;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
inline bool sanitize_value_devices (hb_sanitize_context_t *context, void *base, const Value *values) {
|
||||
inline bool sanitize_value_devices (hb_sanitize_context_t *context, void *base, Value *values) {
|
||||
unsigned int format = *this;
|
||||
|
||||
if (format & xPlacement) values++;
|
||||
|
@ -142,10 +142,10 @@ struct ValueFormat : USHORT
|
|||
if (format & xAdvance) values++;
|
||||
if (format & yAdvance) values++;
|
||||
|
||||
if ((format & xPlaDevice) && !SANITIZE_WITH_BASE (base, *(OffsetTo<Device>*)values++)) return false;
|
||||
if ((format & yPlaDevice) && !SANITIZE_WITH_BASE (base, *(OffsetTo<Device>*)values++)) return false;
|
||||
if ((format & xAdvDevice) && !SANITIZE_WITH_BASE (base, *(OffsetTo<Device>*)values++)) return false;
|
||||
if ((format & yAdvDevice) && !SANITIZE_WITH_BASE (base, *(OffsetTo<Device>*)values++)) return false;
|
||||
if ((format & xPlaDevice) && !CastP<OffsetTo<Device> > (values++)->sanitize (context, base)) return false;
|
||||
if ((format & yPlaDevice) && !CastP<OffsetTo<Device> > (values++)->sanitize (context, base)) return false;
|
||||
if ((format & xAdvDevice) && !CastP<OffsetTo<Device> > (values++)->sanitize (context, base)) return false;
|
||||
if ((format & yAdvDevice) && !CastP<OffsetTo<Device> > (values++)->sanitize (context, base)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -157,13 +157,13 @@ struct ValueFormat : USHORT
|
|||
return (format & devices) != 0;
|
||||
}
|
||||
|
||||
inline bool sanitize_value (hb_sanitize_context_t *context, void *base, const Value *values) {
|
||||
inline bool sanitize_value (hb_sanitize_context_t *context, void *base, Value *values) {
|
||||
TRACE_SANITIZE ();
|
||||
return context->check_range (values, get_size ())
|
||||
&& (!has_device () || sanitize_value_devices (context, base, values));
|
||||
}
|
||||
|
||||
inline bool sanitize_values (hb_sanitize_context_t *context, void *base, const Value *values, unsigned int count) {
|
||||
inline bool sanitize_values (hb_sanitize_context_t *context, void *base, Value *values, unsigned int count) {
|
||||
TRACE_SANITIZE ();
|
||||
unsigned int len = get_len ();
|
||||
|
||||
|
@ -181,7 +181,7 @@ struct ValueFormat : USHORT
|
|||
}
|
||||
|
||||
/* Just sanitize referenced Device tables. Doesn't check the values themselves. */
|
||||
inline bool sanitize_values_stride_unsafe (hb_sanitize_context_t *context, void *base, const Value *values, unsigned int count, unsigned int stride) {
|
||||
inline bool sanitize_values_stride_unsafe (hb_sanitize_context_t *context, void *base, Value *values, unsigned int count, unsigned int stride) {
|
||||
TRACE_SANITIZE ();
|
||||
|
||||
if (!has_device ()) return true;
|
||||
|
@ -275,8 +275,8 @@ struct AnchorFormat3
|
|||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (this, xDeviceTable)
|
||||
&& SANITIZE_WITH_BASE (this, yDeviceTable);
|
||||
&& xDeviceTable.sanitize (context, this)
|
||||
&& yDeviceTable.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -343,7 +343,7 @@ struct AnchorMatrix
|
|||
unsigned int count = rows * cols;
|
||||
if (!context->check_array (matrix, matrix[0].get_size (), count)) return false;
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
if (!SANITIZE_WITH_BASE (this, matrix[i])) return false;
|
||||
if (!matrix[i].sanitize (context, this)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ struct MarkRecord
|
|||
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (base, markAnchor);
|
||||
&& markAnchor.sanitize (context, base);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -408,7 +408,7 @@ struct MarkArray
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, markRecord);
|
||||
return markRecord.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -441,7 +441,7 @@ struct SinglePosFormat1
|
|||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (this, coverage)
|
||||
&& coverage.sanitize (context, this)
|
||||
&& valueFormat.sanitize_value (context, CharP(this), values);
|
||||
}
|
||||
|
||||
|
@ -484,7 +484,7 @@ struct SinglePosFormat2
|
|||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (this, coverage)
|
||||
&& coverage.sanitize (context, this)
|
||||
&& valueFormat.sanitize_values (context, CharP(this), values, valueCount);
|
||||
}
|
||||
|
||||
|
@ -623,7 +623,7 @@ struct PairPosFormat1
|
|||
unsigned int len2 = valueFormat2.get_len ();
|
||||
|
||||
if (!(SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (this, coverage)
|
||||
&& coverage.sanitize (context, this)
|
||||
&& likely (pairSet.sanitize (context, CharP(this), len1 + len2)))) return false;
|
||||
|
||||
if (!(valueFormat1.has_device () || valueFormat2.has_device ())) return true;
|
||||
|
@ -632,10 +632,10 @@ struct PairPosFormat1
|
|||
unsigned int count1 = pairSet.len;
|
||||
for (unsigned int i = 0; i < count1; i++)
|
||||
{
|
||||
const PairSet &pair_set = this+pairSet[i];
|
||||
PairSet &pair_set = const_cast<PairSet &> (this+pairSet[i]); /* XXX clean this up */
|
||||
|
||||
unsigned int count2 = pair_set.len;
|
||||
const PairValueRecord *record = pair_set.array;
|
||||
PairValueRecord *record = pair_set.array;
|
||||
if (!(valueFormat1.sanitize_values_stride_unsafe (context, CharP(this), &record->values[0], count2, stride) &&
|
||||
valueFormat2.sanitize_values_stride_unsafe (context, CharP(this), &record->values[len1], count2, stride)))
|
||||
return false;
|
||||
|
@ -708,9 +708,9 @@ struct PairPosFormat2
|
|||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
if (!(SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, classDef1)
|
||||
&& SANITIZE_WITH_BASE (this, classDef2))) return false;
|
||||
&& coverage.sanitize (context, this)
|
||||
&& classDef1.sanitize (context, this)
|
||||
&& classDef2.sanitize (context, this))) return false;
|
||||
|
||||
unsigned int len1 = valueFormat1.get_len ();
|
||||
unsigned int len2 = valueFormat2.get_len ();
|
||||
|
@ -791,8 +791,8 @@ struct EntryExitRecord
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (base, entryAnchor)
|
||||
&& SANITIZE_WITH_BASE (base, exitAnchor);
|
||||
return entryAnchor.sanitize (context, base)
|
||||
&& exitAnchor.sanitize (context, base);
|
||||
}
|
||||
|
||||
OffsetTo<Anchor>
|
||||
|
@ -988,8 +988,8 @@ struct CursivePosFormat1
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, entryExitRecord);
|
||||
return coverage.sanitize (context, this)
|
||||
&& entryExitRecord.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -1077,9 +1077,9 @@ struct MarkBasePosFormat1
|
|||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (this, markCoverage)
|
||||
&& SANITIZE_WITH_BASE (this, baseCoverage)
|
||||
&& SANITIZE_WITH_BASE (this, markArray)
|
||||
&& markCoverage.sanitize (context, this)
|
||||
&& baseCoverage.sanitize (context, this)
|
||||
&& markArray.sanitize (context, this)
|
||||
&& likely (baseArray.sanitize (context, CharP(this), (unsigned int) classCount));
|
||||
}
|
||||
|
||||
|
@ -1201,9 +1201,9 @@ struct MarkLigPosFormat1
|
|||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (this, markCoverage)
|
||||
&& SANITIZE_WITH_BASE (this, ligatureCoverage)
|
||||
&& SANITIZE_WITH_BASE (this, markArray)
|
||||
&& markCoverage.sanitize (context, this)
|
||||
&& ligatureCoverage.sanitize (context, this)
|
||||
&& markArray.sanitize (context, this)
|
||||
&& likely (ligatureArray.sanitize (context, CharP(this), (unsigned int) classCount));
|
||||
}
|
||||
|
||||
|
@ -1304,9 +1304,9 @@ struct MarkMarkPosFormat1
|
|||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_SELF ()
|
||||
&& SANITIZE_WITH_BASE (this, mark1Coverage)
|
||||
&& SANITIZE_WITH_BASE (this, mark2Coverage)
|
||||
&& SANITIZE_WITH_BASE (this, mark1Array)
|
||||
&& mark1Coverage.sanitize (context, this)
|
||||
&& mark2Coverage.sanitize (context, this)
|
||||
&& mark1Array.sanitize (context, this)
|
||||
&& likely (mark2Array.sanitize (context, CharP(this), (unsigned int) classCount));
|
||||
}
|
||||
|
||||
|
@ -1548,7 +1548,7 @@ struct PosLookup : Lookup
|
|||
TRACE_SANITIZE ();
|
||||
if (unlikely (!Lookup::sanitize (context))) return false;
|
||||
OffsetArrayOf<PosLookupSubTable> &list = CastR<OffsetArrayOf<PosLookupSubTable> > (subTable);
|
||||
return SANITIZE_WITH_BASE (this, list);
|
||||
return list.sanitize (context, this);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1576,7 +1576,7 @@ struct GPOS : GSUBGPOS
|
|||
TRACE_SANITIZE ();
|
||||
if (unlikely (!GSUBGPOS::sanitize (context))) return false;
|
||||
OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList);
|
||||
return SANITIZE_WITH_BASE (this, list);
|
||||
return list.sanitize (context, this);
|
||||
}
|
||||
};
|
||||
ASSERT_SIZE (GPOS, 10);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2007,2008,2009 Red Hat, Inc.
|
||||
* Copyright (C) 2007,2008,2009,2010 Red Hat, Inc.
|
||||
*
|
||||
* This is part of HarfBuzz, a text shaping library.
|
||||
*
|
||||
|
@ -60,7 +60,7 @@ struct SingleSubstFormat1
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
return coverage.sanitize (context, this)
|
||||
&& SANITIZE (deltaGlyphID);
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ struct SingleSubstFormat2
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
return coverage.sanitize (context, this)
|
||||
&& SANITIZE (substitute);
|
||||
}
|
||||
|
||||
|
@ -214,8 +214,8 @@ struct MultipleSubstFormat1
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, sequence);
|
||||
return coverage.sanitize (context, this)
|
||||
&& sequence.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -310,8 +310,8 @@ struct AlternateSubstFormat1
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, alternateSet);
|
||||
return coverage.sanitize (context, this)
|
||||
&& alternateSet.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -463,7 +463,7 @@ struct LigatureSet
|
|||
public:
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, ligature);
|
||||
return ligature.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -495,8 +495,8 @@ struct LigatureSubstFormat1
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, ligatureSet);
|
||||
return coverage.sanitize (context, this)
|
||||
&& ligatureSet.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -626,11 +626,11 @@ struct ReverseChainSingleSubstFormat1
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
if (!(SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, backtrack)))
|
||||
if (!(coverage.sanitize (context, this)
|
||||
&& backtrack.sanitize (context, this)))
|
||||
return false;
|
||||
OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
||||
if (!SANITIZE_WITH_BASE (this, lookahead))
|
||||
if (!lookahead.sanitize (context, this))
|
||||
return false;
|
||||
ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
|
||||
return SANITIZE (substitute);
|
||||
|
@ -860,7 +860,7 @@ struct SubstLookup : Lookup
|
|||
TRACE_SANITIZE ();
|
||||
if (unlikely (!Lookup::sanitize (context))) return false;
|
||||
OffsetArrayOf<SubstLookupSubTable> &list = CastR<OffsetArrayOf<SubstLookupSubTable> > (subTable);
|
||||
return SANITIZE_WITH_BASE (this, list);
|
||||
return list.sanitize (context, this);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -884,12 +884,11 @@ struct GSUB : GSUBGPOS
|
|||
hb_mask_t mask) const
|
||||
{ return get_lookup (lookup_index).apply_string (layout, buffer, mask); }
|
||||
|
||||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
if (unlikely (!GSUBGPOS::sanitize (context))) return false;
|
||||
OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList);
|
||||
return SANITIZE_WITH_BASE (this, list);
|
||||
return list.sanitize (context, this);
|
||||
}
|
||||
};
|
||||
ASSERT_SIZE (GSUB, 10);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2007,2008,2009 Red Hat, Inc.
|
||||
* Copyright (C) 2007,2008,2009,2010 Red Hat, Inc.
|
||||
*
|
||||
* This is part of HarfBuzz, a text shaping library.
|
||||
*
|
||||
|
@ -323,7 +323,7 @@ struct RuleSet
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, rule);
|
||||
return rule.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -355,8 +355,8 @@ struct ContextFormat1
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, ruleSet);
|
||||
return coverage.sanitize (context, this)
|
||||
&& ruleSet.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -398,9 +398,9 @@ struct ContextFormat2
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, classDef)
|
||||
&& SANITIZE_WITH_BASE (this, ruleSet);
|
||||
return coverage.sanitize (context, this)
|
||||
&& classDef.sanitize (context, this)
|
||||
&& ruleSet.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -447,7 +447,7 @@ struct ContextFormat3
|
|||
unsigned int count = glyphCount;
|
||||
if (!context->check_array (coverage, OffsetTo<Coverage>::get_size (), count)) return false;
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
if (!SANITIZE_WITH_BASE (this, coverage[i])) return false;
|
||||
if (!coverage[i].sanitize (context, this)) return false;
|
||||
LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (coverage, OffsetTo<Coverage>::get_size () * count);
|
||||
return context->check_array (lookupRecord, LookupRecord::get_size (), lookupCount);
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ struct ChainRuleSet
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, rule);
|
||||
return rule.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -641,8 +641,8 @@ struct ChainContextFormat1
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, ruleSet);
|
||||
return coverage.sanitize (context, this)
|
||||
&& ruleSet.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -688,11 +688,11 @@ struct ChainContextFormat2
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE_WITH_BASE (this, coverage)
|
||||
&& SANITIZE_WITH_BASE (this, backtrackClassDef)
|
||||
&& SANITIZE_WITH_BASE (this, inputClassDef)
|
||||
&& SANITIZE_WITH_BASE (this, lookaheadClassDef)
|
||||
&& SANITIZE_WITH_BASE (this, ruleSet);
|
||||
return coverage.sanitize (context, this)
|
||||
&& backtrackClassDef.sanitize (context, this)
|
||||
&& inputClassDef.sanitize (context, this)
|
||||
&& lookaheadClassDef.sanitize (context, this)
|
||||
&& ruleSet.sanitize (context, this);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -750,11 +750,11 @@ struct ChainContextFormat3
|
|||
|
||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
if (!SANITIZE_WITH_BASE (this, backtrack)) return false;
|
||||
if (!backtrack.sanitize (context, this)) return false;
|
||||
OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
||||
if (!SANITIZE_WITH_BASE (this, input)) return false;
|
||||
if (!input.sanitize (context, this)) return false;
|
||||
OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (input);
|
||||
if (!SANITIZE_WITH_BASE (this, lookahead)) return false;
|
||||
if (!lookahead.sanitize (context, this)) return false;
|
||||
ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
|
||||
return SANITIZE (lookup);
|
||||
}
|
||||
|
@ -914,9 +914,9 @@ struct GSUBGPOS
|
|||
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||
TRACE_SANITIZE ();
|
||||
return SANITIZE (version) && likely (version.major == 1)
|
||||
&& SANITIZE_WITH_BASE (this, scriptList)
|
||||
&& SANITIZE_WITH_BASE (this, featureList)
|
||||
&& SANITIZE_WITH_BASE (this, lookupList);
|
||||
&& scriptList.sanitize (context, this)
|
||||
&& featureList.sanitize (context, this)
|
||||
&& lookupList.sanitize (context, this);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in New Issue