[cairo] [PATCH 2/4] scaled fonts: Use wide enough type for pointer arithmetic

Simon Richter Simon.Richter at hogyros.de
Thu Feb 11 23:49:16 UTC 2016


On 11.02.2016 21:00, Uli Schlachter wrote:

> Where is this cast back to a pointer that you talk about?

There are two instances in cairo-scaled-font.c, in lines 480 and 2827.
Both of them read

    scaled_font = (cairo_scaled_font_t *) page->cache_entry.hash;

and the pointer is dereferenced afterwards.

I agree with your assessment that this should really be a hash value
only, and using the lower bits might work for that (although the
bottommost bits are probably all zero due to alignment, so it is not a
very good hash), but fixing that requires more changes.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.cairographics.org/archives/cairo/attachments/20160212/ba331b6b/attachment.sig>

More information about the cairo mailing list