Fixes #2296 - SDL_GL_UnbindTexture segfaults (thanks Daniel Bünzli)
authorGabriel Jacobo <gabomdq@gmail.com>
Mon, 24 Feb 2014 18:57:22 -0300
changeset 8249294f28074ecc
parent 8248 427d0a6f5af7
child 8250 e671ec6b22dd
Fixes #2296 - SDL_GL_UnbindTexture segfaults (thanks Daniel Bünzli)
src/render/SDL_render.c
     1.1 --- a/src/render/SDL_render.c	Mon Feb 24 11:24:48 2014 -0500
     1.2 +++ b/src/render/SDL_render.c	Mon Feb 24 18:57:22 2014 -0300
     1.3 @@ -1876,7 +1876,9 @@
     1.4  
     1.5      CHECK_TEXTURE_MAGIC(texture, -1);
     1.6      renderer = texture->renderer;
     1.7 -    if (renderer && renderer->GL_UnbindTexture) {
     1.8 +    if (texture->native) {
     1.9 +        return SDL_GL_UnbindTexture(texture->native);
    1.10 +    } else if (renderer && renderer->GL_UnbindTexture) {
    1.11          return renderer->GL_UnbindTexture(renderer, texture);
    1.12      }
    1.13