gal/opengl: Fix shader link state check

The old code caused a bool (size 1) to be overwritten by a GLint (size
4) causing undefined behaviour.

Fixes https://gitlab.com/kicad/code/kicad/issues/3981
This commit is contained in:
Marcus Comstedt 2020-03-03 18:51:17 +01:00 committed by Seth Hillbrand
parent 9769e1020b
commit 349c0e1a14
1 changed files with 3 additions and 2 deletions

View File

@ -101,8 +101,9 @@ bool SHADER::Link()
programInfo( programNumber ); programInfo( programNumber );
// Check the Link state // Check the Link state
glGetObjectParameterivARB( programNumber, GL_OBJECT_LINK_STATUS_ARB, GLint tmp;
(GLint*) &isShaderLinked ); glGetObjectParameterivARB( programNumber, GL_OBJECT_LINK_STATUS_ARB, &tmp );
isShaderLinked = !!tmp;
#ifdef DEBUG #ifdef DEBUG
if( !isShaderLinked ) if( !isShaderLinked )