mirror of https://github.com/mpv-player/mpv
vo_opengl: check shader string before sscanfing it
This commit is contained in:
parent
94147762fc
commit
368431f57c
|
@ -475,7 +475,7 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
|
|||
} else {
|
||||
gl->glsl_version = 110;
|
||||
int glsl_major = 0, glsl_minor = 0;
|
||||
if (sscanf(shader, "%d.%d", &glsl_major, &glsl_minor) == 2)
|
||||
if (shader && sscanf(shader, "%d.%d", &glsl_major, &glsl_minor) == 2)
|
||||
gl->glsl_version = glsl_major * 100 + glsl_minor;
|
||||
// GLSL 400 defines "sample" as keyword - breaks custom shaders.
|
||||
gl->glsl_version = MPMIN(gl->glsl_version, 330);
|
||||
|
|
Loading…
Reference in New Issue