summaryrefslogtreecommitdiffstats
path: root/video/out/gl_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gl_common.c')
-rw-r--r--video/out/gl_common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index 243f442b4d..131a35daaf 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -833,6 +833,8 @@ mp_image_t *glGetWindowScreenshot(GL *gl)
GLint vp[4]; //x, y, w, h
gl->GetIntegerv(GL_VIEWPORT, vp);
mp_image_t *image = mp_image_alloc(IMGFMT_RGB24, vp[2], vp[3]);
+ if (!image)
+ return NULL;
gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
gl->PixelStorei(GL_PACK_ALIGNMENT, 1);
gl->PixelStorei(GL_PACK_ROW_LENGTH, 0);