Skip to content

Commit

Permalink
avoid NullPointer in SDL_GL_MakeCurrent
Browse files Browse the repository at this point in the history
  • Loading branch information
pionere authored and icculus committed Apr 15, 2022
1 parent 55a4e1d commit 01b14e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/video/SDL_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -3924,6 +3924,10 @@ SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx)
{
int retval;

if (!_this) {
return SDL_UninitializedVideo();
}

if (window == SDL_GL_GetCurrentWindow() &&
ctx == SDL_GL_GetCurrentContext()) {
/* We're already current. */
Expand Down

0 comments on commit 01b14e1

Please sign in to comment.