summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-04 14:27:56 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-08-04 14:27:56 -0400
commit091b0e7a2f0799235b95ed80ab35302d1eaf849c (patch)
tree37d192004313330996a1236953ceaa0ca34f0187
parent14ac615c743186c8aa86691b99d7fef8bfa73f32 (diff)
downloadpango-091b0e7a2f0799235b95ed80ab35302d1eaf849c.tar.gz
[HB] Fix Extension sanitize()
-rw-r--r--pango/opentype/hb-ot-layout-gpos-private.hh3
-rw-r--r--pango/opentype/hb-ot-layout-gsub-private.hh3
-rw-r--r--pango/opentype/hb-ot-layout-gsubgpos-private.hh2
3 files changed, 5 insertions, 3 deletions
diff --git a/pango/opentype/hb-ot-layout-gpos-private.hh b/pango/opentype/hb-ot-layout-gpos-private.hh
index 3229efc7..56481604 100644
--- a/pango/opentype/hb-ot-layout-gpos-private.hh
+++ b/pango/opentype/hb-ot-layout-gpos-private.hh
@@ -1525,7 +1525,8 @@ inline bool ExtensionPos::apply (APPLY_ARG_DEF) const
inline bool ExtensionPos::sanitize (SANITIZE_ARG_DEF)
{
return Extension::sanitize (SANITIZE_ARG) &&
- DECONST_CAST (PosLookupSubTable, get_subtable (), 0).sanitize (SANITIZE_ARG);
+ (&(Extension::get_subtable ()) == &Null(LookupSubTable) ||
+ DECONST_CAST (PosLookupSubTable, get_subtable (), 0).sanitize (SANITIZE_ARG));
}
static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
diff --git a/pango/opentype/hb-ot-layout-gsub-private.hh b/pango/opentype/hb-ot-layout-gsub-private.hh
index b221f6f0..a8977ac5 100644
--- a/pango/opentype/hb-ot-layout-gsub-private.hh
+++ b/pango/opentype/hb-ot-layout-gsub-private.hh
@@ -862,7 +862,8 @@ inline bool ExtensionSubst::apply (APPLY_ARG_DEF) const
inline bool ExtensionSubst::sanitize (SANITIZE_ARG_DEF)
{
return Extension::sanitize (SANITIZE_ARG) &&
- DECONST_CAST (SubstLookupSubTable, get_subtable (), 0).sanitize (SANITIZE_ARG);
+ (&(Extension::get_subtable ()) == &Null(LookupSubTable) ||
+ DECONST_CAST (SubstLookupSubTable, get_subtable (), 0).sanitize (SANITIZE_ARG));
}
static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
diff --git a/pango/opentype/hb-ot-layout-gsubgpos-private.hh b/pango/opentype/hb-ot-layout-gsubgpos-private.hh
index ec305e3c..4a1ab24c 100644
--- a/pango/opentype/hb-ot-layout-gsubgpos-private.hh
+++ b/pango/opentype/hb-ot-layout-gsubgpos-private.hh
@@ -769,7 +769,7 @@ struct ExtensionFormat1
{
friend struct Extension;
- private:
+ protected:
inline unsigned int get_type (void) const { return extensionLookupType; }
inline unsigned int get_offset (void) const { return (extensionOffset[0] << 16) + extensionOffset[1]; }
inline const LookupSubTable& get_subtable (void) const