gfx/cairo/fix-win32-font-assertion.patch
author moz-wptsync-bot <wptsync@mozilla.com>
Thu, 08 Nov 2018 08:22:51 +0000
changeset 506788 f62150dda3664620284888933718cef568d96558
parent 131773 abea8a82da63ab19b359c926459587c498bc229b
permissions -rw-r--r--
Bug 1505638 [wpt PR 13972] - Update wpt metadata, a=testonly wpt-pr: 13972 wpt-type: metadata

From: Jonathan Kew <jkew@mozilla.com>
bug 838617 - don't assert equality with the key's hash unless it was actually initialized. r=roc

diff --git a/gfx/cairo/cairo/src/cairo-win32-font.c b/gfx/cairo/cairo/src/cairo-win32-font.c
--- a/gfx/cairo/cairo/src/cairo-win32-font.c
+++ b/gfx/cairo/cairo/src/cairo-win32-font.c
@@ -2104,19 +2104,19 @@ cairo_win32_font_face_create_for_logfont
     font_face = malloc (sizeof (cairo_win32_font_face_t));
     if (!font_face) {
         _cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
 	goto FAIL;
     }
 
     _cairo_win32_font_face_init_key (font_face, logfont, font);
     _cairo_font_face_init (&font_face->base, &_cairo_win32_font_face_backend);
-    assert (font_face->base.hash_entry.hash == key.base.hash_entry.hash);
 
     if (!font) {
+        assert (font_face->base.hash_entry.hash == key.base.hash_entry.hash);
         status = _cairo_hash_table_insert (hash_table,
                                            &font_face->base.hash_entry);
         if (unlikely (status))
 	    goto FAIL;
     }
 
 DONE:
     if (!font) {