Re: [ft-devel] Fwd: Issue 977845 in chromium: pdf_font_fuzzer: Integer-overflow in compute_glyph_metrics

2019-08-09 Thread Alexei Podtelezhnikov
On Fri, Aug 9, 2019 at 2:38 PM Nikolaus Waxweiler  wrote:
>
> This makes me wonder if maybe FreeType should be compiled with -wrapv
> by default?

.. and undo those macros? These warnings are OCD in its ugliest. It is
fleetingly rare when they reveal real bugs. We silence them but pay
dearly with code readability.

___
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel


Re: [ft-devel] Fwd: Issue 977845 in chromium: pdf_font_fuzzer: Integer-overflow in compute_glyph_metrics

2019-08-09 Thread Nikolaus Waxweiler
This makes me wonder if maybe FreeType should be compiled with -wrapv
by default?

___
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel


Re: [ft-devel] Checking for proper size in `cff_slot_load'

2019-08-09 Thread Moazin Khatri
>
> This looks ok, thanks; an early check is definitely a good thing –
> maybe the late check can even be removed then.
>

The early check only happens if an SVG table exists, otherwise the
control flow remains the same as it was earlier. However, I am not sure
if the late check can really be removed. It's some complicated transform
thing I haven't tried to understand yet.
___
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel


Re: [ft-devel] Checking for proper size in `cff_slot_load'

2019-08-09 Thread Werner LEMBERG
> In `TT_Load_Glyph', there is some code that checks if the sizes have been
> set correctly.  [...]
> 
> For OT-SVG glyphs, I want to check if the size has been set earlier
> than this (because my checks for OT-SVG glyphs come early too).  Are
> there easy ways to do that? Since I only care about `x_ppem' and
> `y_ppem' I can just simply check for those two values as I do here
> .

This looks ok, thanks; an early check is definitely a good thing –
maybe the late check can even be removed then.


Werner
___
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel


[ft-devel] Checking for proper size in `cff_slot_load'

2019-08-09 Thread Moazin Khatri
Hi,

In `TT_Load_Glyph', there is some code that checks if the sizes have been
set correctly.

/* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */
> if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid )
> {
>   error = FT_THROW( Invalid_Size_Handle );
>   goto Exit;
> }


No similar portion is found in `cff_slot_load'. In fact, the check occurs
quite later in the following line:

> error = decoder_funcs->parse_charstrings( &psdecoder,
>   charstring,
>   charstring_len );


For OT-SVG glyphs, I want to check if the size has been set earlier than
this (because my checks for OT-SVG glyphs come early too). Are there easy
ways to do that? Since I only care about `x_ppem' and `y_ppem' I can just
simply check for those two values as I do here
.
If there is a more standard way to do this, please let me know. :)

Moazin
___
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel