Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(863)

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 1483403002: Fix the crash problem on WebGL2 conformance test of negative state api. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e8d9ee846d1ac3f0b0e95e7e5915a68a22b34ce5..3ffa394c3110a1ba86bb439b89749ac374d53bc9 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -2211,8 +2211,13 @@ String WebGL2RenderingContextBase::getActiveUniformBlockName(WebGLProgram* progr
return String();
}
OwnPtr<GLchar[]> name = adoptArrayPtr(new GLchar[maxNameLength]);
- GLsizei length;
+
+ GLsizei length = -1;
Zhenyao Mo 2015/12/02 00:46:10 Initialize length to 0 is enough, returning String
webContext()->getActiveUniformBlockName(objectOrZero(program), uniformBlockIndex, maxNameLength, &length, name.get());
+ if (length <= 0) {
+ synthesizeGLError(GL_INVALID_VALUE, "getActiveUniformBlockName", "invalid uniform block name string");
Ken Russell (switch to Gerrit) 2015/12/02 00:38:42 Is it necessary to synthesize a GL error? One shou
+ return String();
+ }
return String(name.get(), length);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698