On Sat, Jun 30, 2018 at 3:03 AM, Werner LEMBERG <[email protected]> wrote:
> > >> > 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 > This needs enabling debugging, right? > * running `hb-view' with valgrind. > Running in gdb and valgrind both points to the same stacktrace I sent. Inspecting in gdb, sfnt->get_colr_layer is NULL but called on ftobjs.c:5496 > > Werner > -- behdad http://behdad.org/
_______________________________________________ Freetype-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/freetype-devel
