aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/debug_output.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-03-23 23:46:12 -0700
committerKenneth Graunke <[email protected]>2016-03-24 10:47:50 -0700
commitd1bb1df87ed8518693730efc80b3a8b9912bb7bf (patch)
treed1ead7b407a57ef9eac509a6144cf9dcb62667cd /src/mesa/main/debug_output.c
parent028459a00d6faec85ea75ebbaff75fb6f1d91bff (diff)
mesa: Handle negative length in glPushDebugGroup().
The KHR_debug spec doesn't actually say we should handle this, but that is most likely an oversight - it says to check against strlen and generate errors if length is negative. It appears they just forgot to explicitly spell out that we should then proceed to actually handle it. Fixes crashes from uncaught std::string exceptions in many dEQP-GLES31.functional.debug.error_filters.* tests. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
Diffstat (limited to 'src/mesa/main/debug_output.c')
-rw-r--r--src/mesa/main/debug_output.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/debug_output.c b/src/mesa/main/debug_output.c
index 001f63ea94d..85f64bd459f 100644
--- a/src/mesa/main/debug_output.c
+++ b/src/mesa/main/debug_output.c
@@ -1189,6 +1189,9 @@ _mesa_PushDebugGroup(GLenum source, GLuint id, GLsizei length,
if (!validate_length(ctx, callerstr, length, message))
return; /* GL_INVALID_VALUE */
+ if (length < 0)
+ length = strlen(message);
+
debug = _mesa_lock_debug_state(ctx);
if (!debug)
return;