summaryrefslogtreecommitdiff
path: root/src/openglgraphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openglgraphics.cpp')
-rw-r--r--src/openglgraphics.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 332f79823..03d38e7e2 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -1023,6 +1023,9 @@ SDL_Surface* OpenGLGraphics::getScreenshot()
w, h, 24,
0xff0000, 0x00ff00, 0x0000ff, 0x000000);
+ if (!screenshot)
+ return 0;
+
if (SDL_MUSTLOCK(screenshot))
SDL_LockSurface(screenshot);