Chromium Code Reviews| 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..9b51ab2f452e7e8fe89b0155b11abddd3145cf30 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 (!query) |
|
Zhenyao Mo
2015/11/30 18:16:48
You should also check for isContextLost() here.
|
| + 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) { |