Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
index f37c61a4808d9832879583c2321d05c2fdac9602..9ad26770273af8af34d82f96e39cf6abcd97c9cb 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
@@ -7051,14 +7051,17 @@ void GLES2DecoderImpl::DoShaderSource( |
GLuint client_id, GLsizei count, const char** data, const GLint* length) { |
std::string str; |
for (GLsizei ii = 0; ii < count; ++ii) { |
- str.append(data[ii]); |
+ if (length && length[ii] > 0) |
+ str.append(data[ii], length[ii]); |
+ else |
+ str.append(data[ii]); |
} |
Shader* shader = GetShaderInfoNotProgram(client_id, "glShaderSource"); |
if (!shader) { |
return; |
} |
// Note: We don't actually call glShaderSource here. We wait until |
- // the call to glCompileShader. |
+ // we actually compile the shader. |
shader->set_source(str); |
} |