mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user