summaryrefslogtreecommitdiff
path: root/src/video/sdl2_opengl_v.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video/sdl2_opengl_v.cpp')
-rw-r--r--src/video/sdl2_opengl_v.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/video/sdl2_opengl_v.cpp b/src/video/sdl2_opengl_v.cpp
index 08718a01e..202593e64 100644
--- a/src/video/sdl2_opengl_v.cpp
+++ b/src/video/sdl2_opengl_v.cpp
@@ -69,6 +69,11 @@ const char *VideoDriver_SDL_OpenGL::Start(const StringList &param)
int w, h;
SDL_GetWindowSize(this->sdl_window, &w, &h);
this->ClientSizeChanged(w, h, true);
+ /* We should have a valid screen buffer now. If not, something went wrong and we should abort. */
+ if (_screen.dst_ptr == nullptr) {
+ this->Stop();
+ return "Can't get pointer to screen buffer";
+ }
return nullptr;
}