[vlc-commits] vout/opengl: fix null-deref

Thomas Guillem git at videolan.org
Mon Dec 19 15:04:08 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Dec 19 14:48:35 2016 +0100| [1e81cbe879e3155aeb8a015ce9dd75c97ec5a520] | committer: Thomas Guillem

vout/opengl: fix null-deref

This could happen when vout_display_opengl_Delete() was called from
vout_display_opengl_New().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1e81cbe879e3155aeb8a015ce9dd75c97ec5a520
---

 modules/video_output/opengl/vout_helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 19c6d3a..326705b 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -477,7 +477,8 @@ void vout_display_opengl_Delete(vout_display_opengl_t *vgl)
     vgl->api.DeleteShader(vgl->vertex_shader);
     vgl->api.DeleteBuffers(1, &vgl->vertex_buffer_object);
     vgl->api.DeleteBuffers(1, &vgl->index_buffer_object);
-    vgl->api.DeleteBuffers(vgl->chroma->plane_count, vgl->texture_buffer_object);
+    if (vgl->chroma != NULL)
+        vgl->api.DeleteBuffers(vgl->chroma->plane_count, vgl->texture_buffer_object);
     if (vgl->subpicture_buffer_object_count > 0)
         vgl->api.DeleteBuffers(vgl->subpicture_buffer_object_count, vgl->subpicture_buffer_object);
     free(vgl->subpicture_buffer_object);



More information about the vlc-commits mailing list