bug 1260178 null check pattern from -unico-border-gradient r=acomminos
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 29 Mar 2016 17:50:47 +1300
changeset 290904 323653e6a3d9aee66a5a4bdc8c10c25f8953b523
parent 290903 f292de4328044cae93428f9af7281a138a0f9749
child 290905 82a22f34e0e8f3e4f0ac556551df45cb34e6c6fb
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersacomminos
bugs1260178
milestone48.0a1
bug 1260178 null check pattern from -unico-border-gradient r=acomminos 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;