summaryrefslogtreecommitdiffstats
path: root/video/out/vo_sdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/vo_sdl.c')
-rw-r--r--video/out/vo_sdl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 57302b0a41..21b99dcf81 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -917,6 +917,8 @@ static struct mp_image *get_window_screenshot(struct vo *vo)
struct priv *vc = vo->priv;
struct mp_image *image = mp_image_alloc(vc->osd_format.mpv, vo->dwidth,
vo->dheight);
+ if (!image)
+ return NULL;
if (SDL_RenderReadPixels(vc->renderer, NULL, vc->osd_format.sdl,
image->planes[0], image->stride[0])) {
MP_ERR(vo, "SDL_RenderReadPixels failed\n");