[vlc-commits] vout/opengl: fix leak if program check fails

Thomas Guillem git at videolan.org
Tue Dec 13 17:11:01 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Dec  8 12:01:11 2016 +0100| [066d538f69fb8dd3afdd230095ee950a7c79c4c6] | committer: Thomas Guillem

vout/opengl: fix leak if program check fails

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

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

diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 7348433..8ccff38 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -705,7 +705,8 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
         vgl->GetProgramiv(vgl->program[i], GL_LINK_STATUS, &link_status);
         if (link_status == GL_FALSE) {
             fprintf(stderr, "Unable to use program %d\n", i);
-            free(vgl);
+            vlc_gl_Unlock(vgl->gl);
+            vout_display_opengl_Delete(vgl);
             return NULL;
         }
     }



More information about the vlc-commits mailing list