[vlc-commits] gl: fix use-after-free on Close
Thomas Guillem
git at videolan.org
Thu Aug 31 16:47:11 CEST 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Aug 31 16:40:38 2017 +0200| [f96ff3ae2a347f960489451e107c47ae4288b941] | committer: Thomas Guillem
gl: fix use-after-free on Close
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f96ff3ae2a347f960489451e107c47ae4288b941
---
modules/video_output/opengl/vout_helper.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 331f1879d4..16120ae57c 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -879,7 +879,6 @@ void vout_display_opengl_Delete(vout_display_opengl_t *vgl)
opengl_tex_converter_t *tc = vgl->prgm->tc;
if (!tc->handle_texs_gen)
DelTextures(tc, vgl->texture);
- opengl_deinit_program(vgl, vgl->prgm);
tc = vgl->sub_prgm->tc;
for (int i = 0; i < vgl->region_count; i++)
@@ -888,18 +887,21 @@ void vout_display_opengl_Delete(vout_display_opengl_t *vgl)
DelTextures(tc, &vgl->region[i].texture);
}
free(vgl->region);
- opengl_deinit_program(vgl, vgl->sub_prgm);
vgl->vt.DeleteBuffers(1, &vgl->vertex_buffer_object);
vgl->vt.DeleteBuffers(1, &vgl->index_buffer_object);
-
vgl->vt.DeleteBuffers(vgl->prgm->tc->tex_count, vgl->texture_buffer_object);
+
if (vgl->subpicture_buffer_object_count > 0)
- vgl->vt.DeleteBuffers(vgl->subpicture_buffer_object_count, vgl->subpicture_buffer_object);
+ vgl->vt.DeleteBuffers(vgl->subpicture_buffer_object_count,
+ vgl->subpicture_buffer_object);
free(vgl->subpicture_buffer_object);
if (vgl->pool)
picture_pool_Release(vgl->pool);
+ opengl_deinit_program(vgl, vgl->prgm);
+ opengl_deinit_program(vgl, vgl->sub_prgm);
+
free(vgl);
}
More information about the vlc-commits
mailing list