From: Matthias Clasen Date: Sat, 12 Oct 2019 05:00:08 +0000 (-0400) Subject: gl: Don't use memcmp for comparing cache keys X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~729 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0a876f11a0879dc6082d3356f8eb060ddffac1e6;p=gtk4.git gl: Don't use memcmp for comparing cache keys Some innocent change made us use a stack-allocated key, and things broke. Lets go back to comparing cache keys field by field. --- diff --git a/gsk/gl/gskglglyphcache.c b/gsk/gl/gskglglyphcache.c index 66b84a02be..f7cb6fc2c6 100644 --- a/gsk/gl/gskglglyphcache.c +++ b/gsk/gl/gskglglyphcache.c @@ -79,7 +79,14 @@ gsk_gl_glyph_cache_unref (GskGLGlyphCache *self) static gboolean glyph_cache_equal (gconstpointer v1, gconstpointer v2) { - return memcmp (v1, v2, sizeof (GlyphCacheKey)) == 0; + const GlyphCacheKey *key1 = v1; + const GlyphCacheKey *key2 = v2; + + return key1->font == key2->font && + key1->glyph == key2->glyph && + key1->xshift == key2->xshift && + key1->yshift == key2->yshift && + key1->scale == key2->scale; } static guint