diff options
author | Niklas Haas <git@haasn.xyz> | 2018-10-12 08:29:07 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-10-16 01:57:49 +0300 |
commit | 104b51077451a3f9e259ca9aeff0c70ac1aa1d27 (patch) | |
tree | 61ee26e015a0b9bf4a9c81095894938e598bc3e9 /video/out | |
parent | ce27b17a656bc753d03f8675b17d03559abe5058 (diff) |
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/out')
-rw-r--r-- | video/out/opengl/ra_gl.c | 4 |
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); |