[kerx] Fix bound-checking error introduced a couple commits past
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 11 Oct 2018 00:41:16 +0000 (20:41 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 11 Oct 2018 00:41:16 +0000 (20:41 -0400)
src/hb-aat-layout-kerx-table.hh

index 4118d8e..0d3b330 100644 (file)
@@ -180,7 +180,7 @@ struct KerxSubTableFormat2
     unsigned int offset = l + r;
     const FWORD *v = &StructAtOffset<FWORD> (&(this+array), offset);
     if (unlikely ((const char *) v < (const char *) &array ||
-                 (const char *) v + v->static_size - (const char *) this <= header.length))
+                 (const char *) v + v->static_size - (const char *) this > header.length))
       return 0;
     return *v;
   }
@@ -284,7 +284,7 @@ struct KerxSubTableFormat6
       unsigned int offset = l + r;
       const FWORD32 *v = &StructAtOffset<FWORD32> (&(this+t.array), offset * sizeof (FWORD32));
       if (unlikely ((const char *) v < (const char *) &t.array ||
-                   (const char *) v + v->static_size - (const char *) this <= header.length))
+                   (const char *) v + v->static_size - (const char *) this > header.length))
        return 0;
       return *v;
     }
@@ -296,7 +296,7 @@ struct KerxSubTableFormat6
       unsigned int offset = l + r;
       const FWORD *v = &StructAtOffset<FWORD> (&(this+t.array), offset * sizeof (FWORD));
       if (unlikely ((const char *) v < (const char *) &t.array ||
-                   (const char *) v + v->static_size - (const char *) this <= header.length))
+                   (const char *) v + v->static_size - (const char *) this > header.length))
        return 0;
       return *v;
     }