diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2015-11-19 08:12:51 -0800 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2015-11-19 08:14:06 -0800 |
commit | 368431f57c16efd19d0eea316341de0717157001 (patch) | |
tree | 30b16536e1a9e1f298aa711807fc1f59c18e7d4f /video | |
parent | 94147762fce62f5d5d1d29840c8e59835f708b11 (diff) |
vo_opengl: check shader string before sscanfing it
Diffstat (limited to 'video')
-rw-r--r-- | video/out/opengl/common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c index e3e2af6e8b..93b20c04ee 100644 --- a/video/out/opengl/common.c +++ b/video/out/opengl/common.c @@ -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); |