WOFF2 failure

This is regarding <http://test.chrislewis.codes/woff2/>, found on <http://typedrawers.com/discussion/1775/browser-ots-rejections-for-woff2-but-not-woff>; the WOFF2 for the second line of the test page is not being used.

I stepped through I discovered the failure is due to this code in woff2_dec.cc:

    if (PREDICT_FALSE(static_cast<uint64_t>(table.dst_offset + table.dst_length)
        > out->Size())) {
      return FONT_COMPRESSION_FAILURE();
    }

At the point of failure:
    (lldb) p out->Size()
    (size_t) $7 = 405520
    (lldb) p table.dst_offset + table.dst_length
    (unsigned int) $8 = 417149

Now, Khaled commented on the TypeDrawers page to suggest this check is overly strict. Does this mean the reference implementation needs to be fixed?

Received on Wednesday, 21 September 2016 18:12:37 UTC