From a08ce4a06c44aebaa14405a314d6de15e000b2cb Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Mon, 28 May 2018 07:16:40 +0100 Subject: [PATCH] Fix crash if glTexParameter was called when no texture bound --- GL/texture.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GL/texture.c b/GL/texture.c index 713b826..d2845fa 100644 --- a/GL/texture.c +++ b/GL/texture.c @@ -572,6 +572,10 @@ void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param) { TextureObject* active = getBoundTexture(); + if(!active) { + return; + } + if(target == GL_TEXTURE_2D) { switch(pname) { case GL_TEXTURE_MAG_FILTER: