Index: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
index 6d68faaba2df29307afde851c4b63257969c50db..952591508afd358dfdabcb4df97c940210ac74a4 100644 |
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
@@ -1593,6 +1593,9 @@ WebGLQuery* WebGL2RenderingContextBase::createQuery() |
void WebGL2RenderingContextBase::deleteQuery(WebGLQuery* query) |
{ |
+ if (isContextLost() || !query) |
+ return; |
+ |
if (m_currentBooleanOcclusionQuery == query) { |
webContext()->endQueryEXT(m_currentBooleanOcclusionQuery->getTarget()); |
m_currentBooleanOcclusionQuery = nullptr; |
@@ -1617,6 +1620,11 @@ GLboolean WebGL2RenderingContextBase::isQuery(WebGLQuery* query) |
void WebGL2RenderingContextBase::beginQuery(GLenum target, WebGLQuery* query) |
{ |
bool deleted; |
+ if (!query) { |
+ synthesizeGLError(GL_INVALID_OPERATION, "beginQuery", "query object is null"); |
+ return; |
+ } |
+ |
if (!checkObjectToBeBound("beginQuery", query, deleted)) |
return; |
if (deleted) { |