소스 검색

avoid NullPointer in SDL_GL_MakeCurrent

pionere 3 년 전
부모
커밋
01b14e14e6
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/video/SDL_video.c

+ 4 - 0
src/video/SDL_video.c

@@ -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. */