Improve info log length checks
Extend the info log length checks to shader_utils used by tests, and
treat info log with length 1 as empty, since it can only include the
null terminator. At least the Intel GL driver may generate "\0" as
info log in some situations, for example when compiling a user-defined
function with 50000 parameters.
BUG=angleproject:1323
Change-Id: I00f2965539ec235cb949c80c2a9e1d063d32fa15
Reviewed-on: https://chromium-review.googlesource.com/331461
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/renderer/gl/ProgramGL.cpp b/src/libANGLE/renderer/gl/ProgramGL.cpp
index 83d4ca8..cac1985 100644
--- a/src/libANGLE/renderer/gl/ProgramGL.cpp
+++ b/src/libANGLE/renderer/gl/ProgramGL.cpp
@@ -118,7 +118,10 @@
mFunctions->getProgramiv(mProgramID, GL_INFO_LOG_LENGTH, &infoLogLength);
std::string warning;
- if (infoLogLength > 0)
+
+ // Info log length includes the null terminator, so 1 means that the info log is an empty
+ // string.
+ if (infoLogLength > 1)
{
std::vector<char> buf(infoLogLength);
mFunctions->getProgramInfoLog(mProgramID, infoLogLength, nullptr, &buf[0]);