[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Optional fields and stream reading in WOFF2
From: |
Nikhil Ramakrishnan |
Subject: |
Re: [ft-devel] Optional fields and stream reading in WOFF2 |
Date: |
Wed, 12 Jun 2019 00:47:40 +0530 |
Hi,
I have added code (on the GSoC-2019-nikhil branch) to read the WOFF2
header, and I'm using FT_FRAME_START and FT_FRAME_END along with
FT_FRAME_* in this case (fixed size).
> You have to split the handling into fixed-size and variable-size
> parts. For the fixed-size stuff you can use `FT_FRAME_*'; for the
> remaining part you should probably use `FT_NEXT_*', together with
> manual checking whether there is sufficient input. Example:
>
> if ( p + 8 <= limit )
> return FT_THROW( Invalid_Table );
> foo = FT_NEXT_ULONG( p );
> bar = FT_NEXT_ULONG( p );
>
> Have a look at `TT_Load_Simple_Glyph' for some real-world code.
While trying to read the table directory, I am following these steps:
1. Define and assign `FT_Byte* p = stream->cursor;'
2. After reading and validating the header, I say something like
(assuming stream is within limit):
table->FlagByte = FT_NEXT_BYTE( p );
this gives a segmentation fault. Any ideas?
--
Nikhil