check return value of invert_matrix()
[mesa.git] / src / glu / mesa / nurbsutl.c
index b28825858e70a77ff1d77b46d577d602c74e6c58..b46348a50b2c636697b05d6240730e41c1ff26f3 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: nurbsutl.c,v 1.2 2000/07/11 14:11:04 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -130,7 +129,7 @@ set_new_t_min_t_max(knot_str_type * geom_knot, knot_str_type * color_knot,
                    knot_str_type * normal_knot, knot_str_type * texture_knot,
                    GLfloat maximal_min_knot, GLfloat minimal_max_knot)
 {
-   GLuint t_min, t_max, cnt;
+   GLuint t_min = 0, t_max = 0, cnt = 0;
 
    if (minimal_max_knot - maximal_min_knot < EPSILON) {
       /* knot common range empty */
@@ -373,7 +372,7 @@ GLenum explode_knot(knot_str_type * the_knot)
    /* alloc space for new_knot */
    if (
        (new_knot =
-       (GLfloat *) malloc(sizeof(GLfloat) * (nknots + n_new_knots))) == NULL) {
+       (GLfloat *) malloc(sizeof(GLfloat) * (nknots + n_new_knots + 1))) == NULL) {
       return GLU_OUT_OF_MEMORY;
    }
    /* fill in new knot */