Re: WOFF2 failure

LOL, I actually first wrote a much detailed answer then thought it is
too newbish and discarded it.

Yes, you will need to use the new API that uses the WOFF2Out object as
it does not suffer from the limitations of the old API WRT trusting
totalSfntSize and origLength.

Regards,
Khaled

On Wed, Sep 21, 2016 at 11:31:24AM -0700, Ned Holbrook wrote:
> Thanks, but you’ll have to be a bit more explicit for us poor newcomers. :) The fix in this case would be to use the ConvertWOFF2ToTTF() overload taking a WOFF2Out object?
> 
> > On Sep 21, 2016, at 11:25 AM, Khaled Hosny <khaledhosny@eglug.org> wrote:
> > 
> > On Wed, Sep 21, 2016 at 11:11:12AM -0700, Ned Holbrook wrote:
> >> 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?
> > 
> > See:
> > https://github.com/google/woff2/pull/48
> > 
> > Regards,
> > Khaled

Received on Wednesday, 21 September 2016 19:20:51 UTC