[vlc-devel] [PATCH 1/6] opengl: replace runtime check by assertion

Romain Vimont rom1v at videolabs.io
Tue Feb 23 16:06:09 UTC 2021


If vt->GetAttribLocation() returns -1, there is an error in the shader.
---
 modules/video_output/opengl/filter_draw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/video_output/opengl/filter_draw.c b/modules/video_output/opengl/filter_draw.c
index 885ae957b3..01bd3519ab 100644
--- a/modules/video_output/opengl/filter_draw.c
+++ b/modules/video_output/opengl/filter_draw.c
@@ -149,8 +149,7 @@ vlc_gl_filter_draw_Open(struct vlc_gl_filter *filter,
     sys->program_id = program_id;
 
     sys->loc.vertex_pos = vt->GetAttribLocation(program_id, "vertex_pos");
-    if (sys->loc.vertex_pos == -1)
-        goto error;
+    assert(sys->loc.vertex_pos != -1);
 
     vt->GenBuffers(1, &sys->vbo);
 
-- 
2.30.1



More information about the vlc-devel mailing list