From f98e1b0b966d11b50df79d04dbab54ca20a08319 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 4 Jul 2016 13:34:31 +0200 Subject: vo_opengl: error out gracefully when trying to use FBOs without FBO API This can for example happen with vo_opengl_cb, if it is used with a GL implementation that does not supports FBOs. (mpv itself should never attempt to use FBOs if they're not available.) Without this check it would trigger an assert() in our dummy glBindFramebuffer wrapper. Suspected cause of #3308, although it's still unlikely. --- video/out/opengl/video.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video/out/opengl/video.c') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 7ae91eed0d..468bee90b5 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -2667,6 +2667,11 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo) GL *gl = p->gl; struct video_image *vimg = &p->image; + if (fbo && !(gl->mpgl_caps & MPGL_CAP_FB)) { + MP_FATAL(p, "Rendering to FBO requested, but no FBO extension found!\n"); + return; + } + p->broken_frame = false; gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); -- cgit v1.2.3