gfx/cairo/dwrite-font-match-robustness.patch
author Masayuki Nakano <masayuki@d-toybox.com>
Thu, 31 Mar 2016 18:44:01 +0900
changeset 291201 e8b552fe0c258246b47b924834baf8ff4fe422cb
parent 111092 40e9ab16d3b23f7e0bb173f78089bf7f754c3032
permissions -rw-r--r--
Bug 1259664 part.5 Rename WidgetWheelEvent::customizedByUserPrefs to WidgetWheelEvent::mCustomizedByUserPrefs r=smaug MozReview-Commit-ID: 9GksNZRtmmb

From: Robert O'Callahan <robert@ocallahan.org>
Bug 717178. Part 1: Don't crash when passing a nil scaled-font to _name_tables_match. r=jfkthame

diff --git a/gfx/cairo/cairo/src/cairo-dwrite-font.cpp b/gfx/cairo/cairo/src/cairo-dwrite-font.cpp
--- a/gfx/cairo/cairo/src/cairo-dwrite-font.cpp
+++ b/gfx/cairo/cairo/src/cairo-dwrite-font.cpp
@@ -1489,17 +1489,18 @@ static cairo_bool_t
     unsigned long size1;
     unsigned long size2;
     cairo_int_status_t status1;
     cairo_int_status_t status2;
     unsigned char *buffer1;
     unsigned char *buffer2;
     cairo_bool_t result = false;
 
-    if (!font1->backend->load_truetype_table ||
+    if (!font1->backend || !font2->backend ||
+        !font1->backend->load_truetype_table ||
         !font2->backend->load_truetype_table)
         return false;
 
     status1 = font1->backend->load_truetype_table (font1,
                                                    TT_TAG_name, 0, NULL, &size1);
     status2 = font2->backend->load_truetype_table (font2,
                                                    TT_TAG_name, 0, NULL, &size2);
     if (status1 || status2)