diff options
Diffstat (limited to 'progs/glsl')
-rw-r--r-- | progs/glsl/convolutions.c | 2 | ||||
-rw-r--r-- | progs/glsl/shtest.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/progs/glsl/convolutions.c b/progs/glsl/convolutions.c index 350e61bbdc5..fdfaf568a25 100644 --- a/progs/glsl/convolutions.c +++ b/progs/glsl/convolutions.c @@ -182,7 +182,7 @@ static void fillConvolution(GLint *k, static void setupConvolution() { GLint *kernel = (GLint*)malloc(sizeof(GLint) * 9); - GLfloat scale; + GLfloat scale = 0.0; GLfloat *vecKer = (GLfloat*)malloc(sizeof(GLfloat) * 9 * 4); GLuint loc; GLuint i; diff --git a/progs/glsl/shtest.c b/progs/glsl/shtest.c index e9800c307f3..520eccfb6d8 100644 --- a/progs/glsl/shtest.c +++ b/progs/glsl/shtest.c @@ -29,7 +29,6 @@ #include <assert.h> -#include <string.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -549,6 +548,10 @@ ReadConfigFile(const char *filename, struct config_file *conf) type = TypeFromName(typeName); + if (strlen(name) + 1 > sizeof(conf->uniforms[conf->num_uniforms].name)) { + fprintf(stderr, "string overflow\n"); + exit(1); + } strcpy(conf->uniforms[conf->num_uniforms].name, name); conf->uniforms[conf->num_uniforms].value[0] = v1; conf->uniforms[conf->num_uniforms].value[1] = v2; |