[Win] Null pointer crash under WebCore::CACFLayerTreeHost::create().
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2016 20:53:49 +0000 (20:53 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2016 20:53:49 +0000 (20:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162266
<rdar://problem/28345073>

Reviewed by Brent Fulgham.

Add null pointer check.

* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206234 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp

index 5676dda..01a28e2 100644 (file)
@@ -1,3 +1,16 @@
+2016-09-21  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] Null pointer crash under WebCore::CACFLayerTreeHost::create().
+        https://bugs.webkit.org/show_bug.cgi?id=162266
+        <rdar://problem/28345073>
+
+        Reviewed by Brent Fulgham.
+
+        Add null pointer check.
+
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        (WebCore::CACFLayerTreeHost::create):
+
 2016-09-21  Chris Dumez  <cdumez@apple.com>
 
         Fix enumeration of properties cross origin
index 11532ad..34139c7 100644 (file)
@@ -31,6 +31,7 @@
 #include "DefWndProcWindowClass.h"
 #include "FrameView.h"
 #include "LayerChangesFlusher.h"
+#include "Logging.h"
 #include "MainFrame.h"
 #include "PlatformCALayerWin.h"
 #include "PlatformLayer.h"
@@ -117,6 +118,10 @@ PassRefPtr<CACFLayerTreeHost> CACFLayerTreeHost::create()
     if (!acceleratedCompositingAvailable())
         return nullptr;
     RefPtr<CACFLayerTreeHost> host = WKCACFViewLayerTreeHost::create();
+    if (!host) {
+        LOG_ERROR("Failed to create layer tree host for accelerated compositing.");
+        return nullptr;
+    }
     host->initialize();
     return host.release();
 }