vlc | branch: master | Romain Vimont <[email protected]> | Mon Apr 12 17:58:57 
2021 +0200| [b3edf83f5dfb64546683196e562cd46049a30ce6] | committer: Alexandre 
Janniaux

video_filter: opengl: fix error handling

There were 2 problems:
 - if sys->filters could not be created, then vlc_gl_filters_Delete()
   was called, causing a segfault;
 - if the requested filters could not be loaded, then
   vlc_gl_filters_Delete() was not called, leaking sys->filters.

Signed-off-by: Alexandre Janniaux <[email protected]>

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

 modules/video_filter/opengl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/video_filter/opengl.c b/modules/video_filter/opengl.c
index 94dcc9b535..529ebf9a6e 100644
--- a/modules/video_filter/opengl.c
+++ b/modules/video_filter/opengl.c
@@ -232,6 +232,7 @@ static int Open( vlc_object_t *obj )
     if (!sys->filters)
     {
         msg_Err(obj, "Could not create filters");
+        free(glfilters_config);
         goto filters_new_failure;
     }
 
@@ -242,7 +243,7 @@ static int Open( vlc_object_t *obj )
     {
         msg_Err(obj, "Could not load filters: %s", glfilters_config);
         free(glfilters_config);
-        goto filter_config_failure;
+        goto filters_load_failure;
     }
     free(glfilters_config);
 
@@ -290,9 +291,10 @@ static int Open( vlc_object_t *obj )
     return VLC_SUCCESS;
 
 init_framebuffer_failure:
-filters_new_failure:
+filters_load_failure:
     vlc_gl_filters_Delete(sys->filters);
 
+filters_new_failure:
 filter_config_failure:
     vlc_gl_interop_Delete(sys->interop);
 

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to