Index: gpu/blink/webgraphicscontext3d_impl.cc |
diff --git a/gpu/blink/webgraphicscontext3d_impl.cc b/gpu/blink/webgraphicscontext3d_impl.cc |
index 581e10298ec45f87436452ae2fd3410e465e8eab..06185ffc373602c27c67df3abb08bc75658af622 100644 |
--- a/gpu/blink/webgraphicscontext3d_impl.cc |
+++ b/gpu/blink/webgraphicscontext3d_impl.cc |
@@ -361,11 +361,12 @@ bool WebGraphicsContext3DImpl::getActiveAttrib( |
program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_name_length); |
if (max_name_length < 0) |
return false; |
- scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); |
- if (!name) { |
- synthesizeGLError(GL_OUT_OF_MEMORY); |
Zhenyao Mo
2015/03/07 01:00:08
This is unnecessary because we always crash when "
|
+ if (max_name_length == 0) { |
+ // No active attributes exist. |
+ synthesizeGLError(GL_INVALID_VALUE); |
no sievers
2015/03/09 19:10:08
This seems correct if the program is not valid. Bu
no sievers
2015/03/09 19:13:54
nm, we do call getProgramiv() but this is obviousl
Zhenyao Mo
2015/03/09 19:58:28
If the linked program has zero attribs or uniforms
|
return false; |
} |
+ scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); |
GLsizei length = 0; |
GLint size = -1; |
GLenum type = 0; |
@@ -387,11 +388,12 @@ bool WebGraphicsContext3DImpl::getActiveUniform( |
program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &max_name_length); |
if (max_name_length < 0) |
return false; |
- scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); |
- if (!name) { |
- synthesizeGLError(GL_OUT_OF_MEMORY); |
+ if (max_name_length == 0) { |
+ // No active uniforms exist. |
+ synthesizeGLError(GL_INVALID_VALUE); |
return false; |
} |
+ scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); |
GLsizei length = 0; |
GLint size = -1; |
GLenum type = 0; |