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.
This commit is contained in:
Niklas Haas
2018-10-12 08:29:07 +02:00
committed by Jan Ekström
parent ce27b17a65
commit 104b510774

View File

@@ -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);