Skip to content

Commit 6b06043

Browse files
sunshineinaboxicculus
authored andcommitted
egl: Handle error when binding EGL API in context creation
1 parent 55fa5e0 commit 6b06043

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/video/SDL_egl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,10 @@ SDL_GLContext SDL_EGL_CreateContext(SDL_VideoDevice *_this, EGLSurface egl_surfa
11151115
} else {
11161116
_this->egl_data->apitype = EGL_OPENGL_API;
11171117
}
1118-
_this->egl_data->eglBindAPI(_this->egl_data->apitype);
1118+
if (!_this->egl_data->eglBindAPI(_this->egl_data->apitype)) {
1119+
SDL_SetError("Could not bind EGL API");
1120+
return NULL;
1121+
}
11191122

11201123
egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display,
11211124
_this->egl_data->egl_config,

0 commit comments

Comments
 (0)