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

_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to