summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2018-10-12 08:29:07 +0200
committerJan Ekström <jeebjp@gmail.com>2018-10-16 01:57:49 +0300
commit104b51077451a3f9e259ca9aeff0c70ac1aa1d27 (patch)
tree61ee26e015a0b9bf4a9c81095894938e598bc3e9 /video
parentce27b17a656bc753d03f8675b17d03559abe5058 (diff)
downloadmpv-104b51077451a3f9e259ca9aeff0c70ac1aa1d27.tar.bz2
mpv-104b51077451a3f9e259ca9aeff0c70ac1aa1d27.tar.xz
vo_gpu: opengl: fix segfault when gl->DeleteSync is unavailable
This deinit code was never checked, so this line would always crash on implementations without support for sync objects. Fixes #6197.
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/ra_gl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c
index 7112464e87..70bd9f61aa 100644
--- a/video/out/opengl/ra_gl.c
+++ b/video/out/opengl/ra_gl.c
@@ -542,7 +542,9 @@ static void gl_buf_destroy(struct ra *ra, struct ra_buf *buf)
GL *gl = ra_gl_get(ra);
struct ra_buf_gl *buf_gl = buf->priv;
- gl->DeleteSync(buf_gl->fence);
+ if (buf_gl->fence)
+ gl->DeleteSync(buf_gl->fence);
+
if (buf->data) {
gl->BindBuffer(buf_gl->target, buf_gl->buffer);
gl->UnmapBuffer(buf_gl->target);