From 3451f7e760309802b1297c9fc9db95e42ec525ab Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 7 Jan 2016 21:48:06 +0100 Subject: [PATCH] gsdx-ogl: handle invalid gl_lengh in debug message Mesa intel sets it to -1. Close #1089 --- plugins/GSdx/GSDeviceOGL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 6f2780b67d..73db97de5f 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -1522,7 +1522,7 @@ void GSDeviceOGL::CheckDebugLog() // Note: used as a callback of DebugMessageCallback. Don't change the signature void GSDeviceOGL::DebugOutputToFile(GLenum gl_source, GLenum gl_type, GLuint id, GLenum gl_severity, GLsizei gl_length, const GLchar *gl_message, const void* userParam) { - std::string message(gl_message, gl_length); + std::string message(gl_message, gl_length >= 0 ? gl_length : strlen(gl_message)); std::string type, severity, source; static int sev_counter = 0; switch(gl_type) {