Fix sanitize or Context Rule
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 10 Sep 2018 13:45:32 +0000 (15:45 +0200)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 10 Sep 2018 13:45:32 +0000 (15:45 +0200)
Fixes https://github.com/harfbuzz/harfbuzz/issues/1110

src/hb-ot-layout-gsubgpos.hh

index 315951a..bd4611d 100644 (file)
@@ -1267,7 +1267,7 @@ struct Rule
     return_trace (inputCount.sanitize (c) &&
                  lookupCount.sanitize (c) &&
                  c->check_range (inputZ,
-                                 inputZ[0].static_size * inputCount +
+                                 inputZ[0].static_size * (inputCount ? inputCount - 1 : 0) +
                                  LookupRecord::static_size * lookupCount));
   }