|
From: | Behdad Esfahbod |
Subject: | Re: [ft-devel] Fwd: completed CPAL/COLR support |
Date: | Sat, 30 Jun 2018 03:18:59 -0400 |
>> > Third, "palette[layer_color_index]" is recipe for invalid memory
>> > access.
>>
>> Is it? The code checks that `layer_color_index' is not out of
>> bound. Do you have a better idea?
>
> What does the code do if the font has bad index then?
It simply returns 0, as documented.
> Maybe treating those as foreground works.
Mhmm. I could implement that, but is this a good idea? Wouldn't it
be better if the rendering engine drops invalid color layered glyphs,
returning the `standard' outline instead?
>> What I could do is to make the magic number 0xFFFF completely
>> disappear by giving it index `num_palette_entries' while increasing
>> the size of `palette' (and `num_palette_entries') by one element...
>
> I'd say stay close to the spec. Just document returning 0xFFFF.
OK.
> Ok, bigger problem. I'm getting crashes rendering anything using
> hb-view: [...]
Please repeat your test with
* compiling with `-O0 -g3',
* setting `FT2_DEBUG=any:7', and
* running `hb-view' with valgrind.
Werner
[Prev in Thread] | Current Thread | [Next in Thread] |