From aabe12b0bc4cdf13c494dc8f725174e3a1c07786 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 22 Sep 2017 14:19:11 +0200 Subject: vo_gpu: opengl: fix possible screenshot window crash gl_read_fbo_contents can fail Fixes #4905 --- video/out/opengl/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'video') diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c index 6c8821f6c7..85be3a0ace 100644 --- a/video/out/opengl/context.c +++ b/video/out/opengl/context.c @@ -260,7 +260,7 @@ struct mp_image *ra_gl_ctx_screenshot(struct ra_swapchain *sw) // OpenGL FB is also read in flipped order, so we need to flip when the // rendering is *not* flipped, which in our case is whenever // p->params.flipped is true. I hope that made sense - if (p->params.flipped) + if (screen && p->params.flipped) mp_image_vflip(screen); return screen; -- cgit v1.2.3