bug 1260178 null check pattern from -unico-border-gradient r?acomminos draft
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 29 Mar 2016 17:50:47 +1300
changeset 345387 99ad62a6162a6aa88d77c965380b2b1f7ec214bb
parent 345348 a66bf0a800f3d859b4bd2ceebc57b2e3fa6544d8
child 517188 d19fc4b162b14288d4b9f0b5920ecd03edf39672
push id14082
push userktomlinson@mozilla.com
push dateTue, 29 Mar 2016 04:53:43 +0000
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;