[Chromium] Crash in Canvas2DLayerChromium::pushPropertiesTo
[WebKit-https.git] / Source / WebCore / platform / graphics / chromium / Canvas2DLayerChromium.cpp
index 7003826d70e18c32aadb184632122db5b221270d..1d3d369a1395031ef0d6072df08a2e9d3260ed26 100644 (file)
@@ -154,9 +154,12 @@ void Canvas2DLayerChromium::pushPropertiesTo(CCLayerImpl* layer)
     CanvasLayerChromium::pushPropertiesTo(layer);
 
     CCTextureLayerImpl* textureLayer = static_cast<CCTextureLayerImpl*>(layer);
     CanvasLayerChromium::pushPropertiesTo(layer);
 
     CCTextureLayerImpl* textureLayer = static_cast<CCTextureLayerImpl*>(layer);
-    if (m_useDoubleBuffering)
-        textureLayer->setTextureId(m_frontTexture->textureId());
-    else
+    if (m_useDoubleBuffering) {
+        if (m_frontTexture && m_frontTexture->isValid(m_size, GraphicsContext3D::RGBA))
+            textureLayer->setTextureId(m_frontTexture->textureId());
+        else
+            textureLayer->setTextureId(0);
+    } else
         textureLayer->setTextureId(m_backTextureId);
 }
 
         textureLayer->setTextureId(m_backTextureId);
 }