Skip to content

Commit

Permalink
video_filter: opengl: fix error handling
Browse files Browse the repository at this point in the history
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 <ajanni@videolabs.io>
  • Loading branch information
rom1v authored and alexandre-janniaux committed Apr 20, 2021
1 parent f565860 commit b3edf83
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/video_filter/opengl.c
Expand Up @@ -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;
}

Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit b3edf83

Please sign in to comment.