Bug 1260178 - Null check pattern from -unico-border-gradient. r=acomminos, a=ritu
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 29 Mar 2016 17:50:47 +1300
changeset 323760 84d924134d1384e94d3227f21915f28b2841a9d7
parent 323759 470551cf10ebceb65c7b36c4fb6d6f51c2974562
child 323761 477b227b6224431e51ac256e37e96498e4843cf4
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersacomminos, ritu
bugs1260178
milestone47.0a2
Bug 1260178 - Null check pattern from -unico-border-gradient. r=acomminos, a=ritu MozReview-Commit-ID: HooAlTmINmq
widget/gtk/nsLookAndFeel.cpp
--- a/widget/gtk/nsLookAndFeel.cpp
+++ b/widget/gtk/nsLookAndFeel.cpp
@@ -78,16 +78,18 @@ GetLightAndDarkness(const GdkRGBA& aColo
 static bool
 GetGradientColors(const GValue* aValue,
                   GdkRGBA* aLightColor, GdkRGBA* aDarkColor)
 {
     if (!G_TYPE_CHECK_VALUE_TYPE(aValue, CAIRO_GOBJECT_TYPE_PATTERN))
         return false;
 
     auto pattern = static_cast<cairo_pattern_t*>(g_value_get_boxed(aValue));
+    if (!pattern)
+        return false;
 
     // Just picking the lightest and darkest colors as simple samples rather
     // than trying to blend, which could get messy if there are many stops.
     if (CAIRO_STATUS_SUCCESS !=
         cairo_pattern_get_color_stop_rgba(pattern, 0, nullptr, &aDarkColor->red,
                                           &aDarkColor->green, &aDarkColor->blue,
                                           &aDarkColor->alpha))
         return false;