diff options
author | wm4 <wm4@nowhere> | 2017-08-15 18:45:22 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-08-15 18:59:59 +0200 |
commit | b44e81d9c3c7a1597ba825997622d93033025aab (patch) | |
tree | 4fbccff8059224467c18897d817a25fe83a38540 /video/out/opengl/ra_gl.c | |
parent | 72a8120daac8136b8db7c720621bbe09e43cfe6c (diff) | |
download | mpv-b44e81d9c3c7a1597ba825997622d93033025aab.tar.bz2 mpv-b44e81d9c3c7a1597ba825997622d93033025aab.tar.xz |
vo_opengl: fix dangling pointers when VAOs are not available
This is for legacy GL: if VAOs are not available, the helper has to
specify vertex attributes again on every rendering. gl_vao_init() keeps
the vertex array for this purpose. Unfortunately, a temporary argument
was passed to the function, instead of the permanent copy.
Also, it didn't use num_entries (instead expected the array being
terminated by a {0} entry). Fix that source code indentation too.
Diffstat (limited to 'video/out/opengl/ra_gl.c')
-rw-r--r-- | video/out/opengl/ra_gl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c index 5f8c525f5b..7dd3a43d13 100644 --- a/video/out/opengl/ra_gl.c +++ b/video/out/opengl/ra_gl.c @@ -810,8 +810,8 @@ static struct ra_renderpass *gl_renderpass_create(struct ra *ra, } gl->UseProgram(0); - gl_vao_init(&pass_gl->vao, gl, params->vertex_stride, params->vertex_attribs, - params->num_vertex_attribs); + gl_vao_init(&pass_gl->vao, gl, pass->params.vertex_stride, + pass->params.vertex_attribs, pass->params.num_vertex_attribs); return pass; } |