From d23bb22f6258a4b55af42fdb3f29fec2e694df72 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 22 Nov 2009 01:45:53 -0500 Subject: glu: Fix memory leak in __gl_meshMakeEdge. (cherry picked from commit d3b4c99c703f70a9d0e715a97e52672f7f8fc980) --- src/glu/sgi/libtess/mesh.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libtess/mesh.c b/src/glu/sgi/libtess/mesh.c index ae861f86428..95f87cdc949 100644 --- a/src/glu/sgi/libtess/mesh.c +++ b/src/glu/sgi/libtess/mesh.c @@ -284,7 +284,12 @@ GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ) } e = MakeEdge( &mesh->eHead ); - if (e == NULL) return NULL; + if (e == NULL) { + memFree(newVertex1); + memFree(newVertex2); + memFree(newFace); + return NULL; + } MakeVertex( newVertex1, e, &mesh->vHead ); MakeVertex( newVertex2, e->Sym, &mesh->vHead ); -- cgit v1.2.3 From fe38c16021694145b2c96818e0c0fb095e42c03b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 22 Nov 2009 01:57:35 -0500 Subject: glu/sgi: Fix memory leak in gluScaleImage. (cherry picked from commit a9c540f5dedbf593f8038fdbc95eecb60826ab26) --- src/glu/sgi/libutil/mipmap.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index af647af73c9..4139c304a1d 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -3526,6 +3526,8 @@ gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, afterImage = malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT)); if (beforeImage == NULL || afterImage == NULL) { + free(beforeImage); + free(afterImage); return GLU_OUT_OF_MEMORY; } -- cgit v1.2.3 From 6c1fc2b2a5c80697dff304562e79dae25d9f2cb1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 23 Nov 2009 00:57:37 -0500 Subject: glu/sgi: Fix memory leak in gluScaleImage3D. (cherry picked from commit b611f639b4bffdcca376293f7ce71af9f6bdbff3) --- src/glu/sgi/libutil/mipmap.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 4139c304a1d..223621f49fc 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -7384,6 +7384,8 @@ int gluScaleImage3D(GLenum format, afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format, GL_UNSIGNED_SHORT)); if (beforeImage == NULL || afterImage == NULL) { + free(beforeImage); + free(afterImage); return GLU_OUT_OF_MEMORY; } retrieveStoreModes3D(&psm); -- cgit v1.2.3 From 80a3944a4d6a07793872d283633546d482cf61b7 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 23 Nov 2009 01:09:06 -0500 Subject: glu/sgi: Fix memory leak in bitmapBuild2DMipmaps. (cherry picked from commit 5b925b7daa566d799c4f50911a7fcca114131503) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 223621f49fc..c5faebd6a35 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -3762,6 +3762,7 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(newImage); return GLU_OUT_OF_MEMORY; } } -- cgit v1.2.3 From 7ed749c062c2bc2b048a34f8e4c6b0a5198e32bb Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 24 Nov 2009 01:23:12 -0500 Subject: glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore. (cherry picked from commit 326b66d724754ca97012501db1c7c62d7d41a457) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index c5faebd6a35..a5d07a59cf7 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -8232,6 +8232,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + free(srcImage); return GLU_OUT_OF_MEMORY; } } -- cgit v1.2.3 From 7b5eba453e08dfad151d09ba4d308cbdf4fc83af Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 25 Nov 2009 00:18:49 -0500 Subject: glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore. (cherry picked from commit f895abbd9777c4985aa40cf660c68f6d7333f0ec) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index a5d07a59cf7..22d702291f0 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -8098,6 +8098,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + free(srcImage); return GLU_OUT_OF_MEMORY; } /* level userLevel+1 is in srcImage; level userLevel already saved */ -- cgit v1.2.3 From ea487c6d0b261bf90e898f51bc9f872de8166ddb Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 25 Nov 2009 00:28:56 -0500 Subject: glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore. (cherry picked from commit 0d89f3dc7ff3f89ba8d5d664253730485bca35e2) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 22d702291f0..796be0aad38 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -4349,6 +4349,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(srcImage); return GLU_OUT_OF_MEMORY; } } -- cgit v1.2.3 From 8df551c46bc15a4b1ce1dc11e083498442018418 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 25 Nov 2009 00:39:37 -0500 Subject: glu/sgi: Fix memory leak in gluBuild1DMipmapLevelsCore. (cherry picked from commit 94bcb9f1a43f2ab3bdff09156e3ab5b1c115cbd8) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 796be0aad38..bf6eaf88c6d 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -3608,6 +3608,7 @@ int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(newImage); return GLU_OUT_OF_MEMORY; } } -- cgit v1.2.3 From c74afe0c46dbd0f90361c06526f70885a9061e8e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 26 Nov 2009 00:35:31 -0500 Subject: glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore. (cherry picked from commit 808f0376607b0e2d31dfebc888fd8f1e737fed09) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index bf6eaf88c6d..d1fd5a7d724 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -4108,6 +4108,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(srcImage); return GLU_OUT_OF_MEMORY; } /* level userLevel+1 is in srcImage; level userLevel already saved */ -- cgit v1.2.3 From 57b5ca5d11044d06f8969d54ff01c27ff44585ac Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 22 Dec 2009 23:07:00 -0800 Subject: glu/sgi: Silence uninitialized variable warnings. --- src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc | 4 ++-- src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc index e12f88bab12..2e70f839363 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc @@ -207,7 +207,7 @@ void sampleBotRightWithGridLine(Real* botVertex, return; } - Int segIndexMono, segIndexPass; + Int segIndexMono = 0, segIndexPass; findBotRightSegment(rightChain, rightEnd, rightCorner, @@ -293,7 +293,7 @@ void sampleBotLeftWithGridLine(Real* botVertex, return; } - Int segIndexPass, segIndexMono; + Int segIndexPass, segIndexMono = 0; findBotLeftSegment(leftChain, leftEnd, leftCorner, grid->get_u_value(leftU), segIndexMono, segIndexPass); sampleBotLeftWithGridLinePost(botVertex, diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc index b7b929623a2..951e937c45f 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc @@ -172,7 +172,7 @@ void sampleTopRightWithGridLine(Real* topVertex, return; } - Int segIndexSmall, segIndexLarge; + Int segIndexSmall = 0, segIndexLarge; findTopRightSegment(rightChain, rightStart, rightEnd, @@ -294,7 +294,7 @@ void sampleTopLeftWithGridLine(Real* topVertex, primStream* pStream ) { - Int segIndexSmall, segIndexLarge; + Int segIndexSmall = 0, segIndexLarge; //if left chain is empty, then there is only one top vertex with one grid // line if(leftEnd < leftStart) { -- cgit v1.2.3 From 6138145b350d9e58725b43162680b43904497ec8 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 23 Dec 2009 16:11:10 -0800 Subject: glu/sgi: Silence compiler warnings. --- src/glu/sgi/libnurbs/internals/subdivider.cc | 6 ++++-- src/glu/sgi/libnurbs/nurbtess/partitionY.cc | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/subdivider.cc b/src/glu/sgi/libnurbs/internals/subdivider.cc index cc0b5147065..ccddc270ff9 100644 --- a/src/glu/sgi/libnurbs/internals/subdivider.cc +++ b/src/glu/sgi/libnurbs/internals/subdivider.cc @@ -531,16 +531,18 @@ Subdivider::nonSamplingSplit( patchlist.pspec[param].range[1] ) * 0.5; split( source, left, right, param, mid ); Patchlist subpatchlist( patchlist, param, mid ); - if( left.isnonempty() ) + if( left.isnonempty() ) { if( subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT ) freejarcs( left ); else nonSamplingSplit( left, subpatchlist, subdivisions-1, param ); - if( right.isnonempty() ) + } + if( right.isnonempty() ) { if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT ) freejarcs( right ); else nonSamplingSplit( right, patchlist, subdivisions-1, param ); + } } else { // make bbox calls diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc index 297c6299766..e097461ac5e 100644 --- a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc +++ b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc @@ -111,8 +111,8 @@ Int isCusp(directedLine *v) else if(A[1] > B[1] && C[1] > B[1]) return 1; - if(isAbove(v, v) && isAbove(v, v->getPrev()) || - isBelow(v, v) && isBelow(v, v->getPrev())) + if((isAbove(v, v) && isAbove(v, v->getPrev())) || + (isBelow(v, v) && isBelow(v, v->getPrev()))) return 1; else return 0; -- cgit v1.2.3 From 261c3cd530437362f906ef78459ffda7ab2b2077 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 23 Dec 2009 17:50:02 -0800 Subject: glu/sgi: Initialize variable in directedLine. --- src/glu/sgi/libnurbs/nurbtess/directedLine.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc index 74450352d8c..5be1ae3976a 100644 --- a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc +++ b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc @@ -800,7 +800,7 @@ directedLine* readAllPolygons(char* filename) { Int nEdges; fscanf(fp, "%i", &nEdges); - Real vert[2][2]; + Real vert[2][2] = { { 0 } }; Real VV[2][2]; /*the first two vertices*/ fscanf(fp, "%f", &(vert[0][0])); -- cgit v1.2.3 From 67a4abcc3b9daabdf873d750e689893fcc94e4d5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 25 Dec 2009 14:23:10 -0800 Subject: glu/sgi: Fix include recursion. arcsorter.h should not include itself. --- src/glu/sgi/libnurbs/internals/arcsorter.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/arcsorter.h b/src/glu/sgi/libnurbs/internals/arcsorter.h index d72dd1e86ce..a55df926772 100644 --- a/src/glu/sgi/libnurbs/internals/arcsorter.h +++ b/src/glu/sgi/libnurbs/internals/arcsorter.h @@ -37,7 +37,6 @@ #define __gluarcsorter_h_ #include "sorter.h" -#include "arcsorter.h" class Arc; class Subdivider; -- cgit v1.2.3 From 495b8f8f7a58616d7b75a84d828e3ea356b9a1d4 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 14:28:33 -0800 Subject: glu/sgi: Initialize members of class directedLine. --- src/glu/sgi/libnurbs/nurbtess/directedLine.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc index 5be1ae3976a..1ceda025d9f 100644 --- a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc +++ b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc @@ -309,6 +309,8 @@ directedLine::directedLine() nextPolygon = NULL; rootBit = 0;/*important to initilzae to 0 meaning not root yet*/ rootLink = NULL; + direction = INCREASING; + sline = NULL; } directedLine::~directedLine() -- cgit v1.2.3 From 5060fb428d841154013a49af7d4efc3144792260 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 17:22:11 -0800 Subject: glu/sgi: Initialize members of class sampledLine. --- src/glu/sgi/libnurbs/nurbtess/sampledLine.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc index 6253a7c09d3..89f6c6e23fe 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc @@ -107,6 +107,9 @@ sampledLine::sampledLine(Real pt1[2], Real pt2[2]) //needs tp call init to setup sampledLine::sampledLine() { + npoints = 0; + points = NULL; + next = NULL; } //warning: ONLY pointer is copies!!! -- cgit v1.2.3 From a7db305c2f9fd4ee43b12ed0ef19efc1532cc30d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 17:35:22 -0800 Subject: glu/sgi: Initialize member of class monoChain. --- src/glu/sgi/libnurbs/nurbtess/monoChain.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/nurbtess/monoChain.cc b/src/glu/sgi/libnurbs/nurbtess/monoChain.cc index 814bf32fae0..b17b9405c1a 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoChain.cc +++ b/src/glu/sgi/libnurbs/nurbtess/monoChain.cc @@ -127,6 +127,7 @@ monoChain::monoChain(directedLine* cHead, directedLine* cTail) current = chainTail; isKey = 0; + keyY = 0; } //insert a new line between prev and this -- cgit v1.2.3 From 3bcf7d7d7be074246d815fdf4a486e08f5db46a3 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 17:46:42 -0800 Subject: glu/sgi: Initialize member variables in class Varray. --- src/glu/sgi/libnurbs/internals/varray.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/varray.cc b/src/glu/sgi/libnurbs/internals/varray.cc index 31cc73a9d08..1cb235443ad 100644 --- a/src/glu/sgi/libnurbs/internals/varray.cc +++ b/src/glu/sgi/libnurbs/internals/varray.cc @@ -53,8 +53,16 @@ inline long sgn( REAL x ) Varray::Varray( void ) { + int i; + varray = 0; size = 0; + numquads = 0; + + for (i = 0; i < 1000; i++) { + vval[i] = 0; + voffset[i] = 0; + } } Varray::~Varray( void ) -- cgit v1.2.3 From 97b899374cf6f2f3926863ca70c5561ef6c189a9 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 20:45:24 -0800 Subject: glu/sgi: Initialize member of struct GridVertex. --- src/glu/sgi/libnurbs/internals/gridvertex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/gridvertex.h b/src/glu/sgi/libnurbs/internals/gridvertex.h index 36a65c7bdd3..2e27436ef81 100644 --- a/src/glu/sgi/libnurbs/internals/gridvertex.h +++ b/src/glu/sgi/libnurbs/internals/gridvertex.h @@ -38,7 +38,7 @@ struct GridVertex { long gparam[2]; - GridVertex( void ) {} + GridVertex( void ) { gparam[0] = 0, gparam[1] = 0; } GridVertex( long u, long v ) { gparam[0] = u, gparam[1] = v; } void set( long u, long v ) { gparam[0] = u, gparam[1] = v; } long nextu() { return gparam[0]++; } -- cgit v1.2.3 From 70bbe2236668bdee9131dc2e6f71e53f9bc78863 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 21:03:23 -0800 Subject: glu/sgi: Silence warn_unused_result warnings. --- src/glu/sgi/libnurbs/nurbtess/directedLine.cc | 28 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc index 1ceda025d9f..d942db7287e 100644 --- a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc +++ b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc @@ -793,22 +793,30 @@ directedLine* readAllPolygons(char* filename) { Int i,j; FILE* fp = fopen(filename, "r"); - assert(fp); Int nPolygons; - fscanf(fp, "%i", &nPolygons); + int result; + + assert(fp); + result = fscanf(fp, "%i", &nPolygons); + assert(result != EOF); directedLine *ret = NULL; for(i=0; irootLinkSet(NULL); { vert[0][0]=vert[1][0]; vert[0][1]=vert[1][1]; - fscanf(fp, "%f", &(vert[1][0])); - fscanf(fp, "%f", &(vert[1][1])); + result = fscanf(fp, "%f", &(vert[1][0])); + assert(result != EOF); + result = fscanf(fp, "%f", &(vert[1][1])); + assert(result != EOF); sLine = new sampledLine(2,vert); dLine = new directedLine(INCREASING, sLine); dLine->rootLinkSet(thisPoly); -- cgit v1.2.3 From de95e5768bf5186a29c75981350042581b760684 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 29 Dec 2009 22:29:53 -0800 Subject: glu/sgi: Initialize members of struct O_nurbssurface. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 8a8dcebb501..3f259c777b5 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -106,7 +106,7 @@ struct O_nurbssurface : public PooledObj { int save; /* 1 if in display list */ int used; /* 1 if prev called in block */ O_nurbssurface( long _type ) - { type = _type; owner = 0; next = 0; used = 0; } + { bezier_patches = 0; type = _type; owner = 0; next = 0; save = 0; used = 0; } }; struct O_surface : public PooledObj { -- cgit v1.2.3 From 5d3d202ac991bd1a67ba40f4be145621b35620fe Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Jan 2010 14:39:16 -0800 Subject: glu/sgi: Initialize member of struct Property. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 3f259c777b5..e5ec1827dbf 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -125,7 +125,7 @@ struct Property : public PooledObj { Property( long _type, long _tag, INREAL _value ) { type = _type; tag = _tag; value = (REAL) _value; } Property( long _tag, INREAL _value ) - { type = 0; tag = _tag; value = (REAL) _value; } + { type = 0; tag = _tag; value = (REAL) _value; save = 0; } }; class NurbsTessellator; -- cgit v1.2.3 From a349687d499a76496dc9433d5437398f774f0bd4 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Jan 2010 14:46:11 -0800 Subject: glu/sgi: Initialize members of class Knotvector. --- src/glu/sgi/libnurbs/internals/knotvector.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/knotvector.cc b/src/glu/sgi/libnurbs/internals/knotvector.cc index 9eb5cbace94..dcbf0067d85 100644 --- a/src/glu/sgi/libnurbs/internals/knotvector.cc +++ b/src/glu/sgi/libnurbs/internals/knotvector.cc @@ -61,6 +61,9 @@ void Knotvector::init( long _knotcount, long _stride, long _order, INREAL *_knot Knotvector::Knotvector( void ) { + knotcount = 0; + stride = 0; + order = 0; knotlist = 0; } -- cgit v1.2.3 From 64a19610112efdbde9daa81b742a081832d186e9 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Jan 2010 17:19:27 -0800 Subject: glu/sgi: Initialize members of struct O_nurbscurve. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index e5ec1827dbf..faa26101cf3 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -77,7 +77,7 @@ struct O_nurbscurve : public PooledObj { int save; /* 1 if in display list */ O_curve * owner; /* owning curve */ O_nurbscurve( long _type ) - { type = _type; owner = 0; next = 0; used = 0; } + { bezier_curves = 0; type = _type; tesselation = 0; method = 0; next = 0; used = 0; save = 0; owner = 0; } }; class O_pwlcurve : public PooledObj { -- cgit v1.2.3 From 2c64e4c50eaf7c3dd0cc95edbca1d31316baac3a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Jan 2010 17:25:16 -0800 Subject: glu/sgi: Initialize member of struct Dlnode. --- src/glu/sgi/libnurbs/internals/displaylist.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/displaylist.h b/src/glu/sgi/libnurbs/internals/displaylist.h index 22cbec37870..d009a42513e 100644 --- a/src/glu/sgi/libnurbs/internals/displaylist.h +++ b/src/glu/sgi/libnurbs/internals/displaylist.h @@ -59,6 +59,7 @@ Dlnode::Dlnode( PFVS _work, void *_arg, PFVS _cleanup ) work = _work; arg = _arg; cleanup = _cleanup; + next = 0; } class DisplayList { -- cgit v1.2.3 From 37e5626111ea99409d41af9581a3bc32a5d1519f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 1 Jan 2010 23:01:03 -0800 Subject: glu/sgi: Initialize member of struct Property. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index faa26101cf3..48249466f36 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -123,7 +123,7 @@ struct Property : public PooledObj { REAL value; int save; /* 1 if in display list */ Property( long _type, long _tag, INREAL _value ) - { type = _type; tag = _tag; value = (REAL) _value; } + { type = _type; tag = _tag; value = (REAL) _value; save = 0; } Property( long _tag, INREAL _value ) { type = 0; tag = _tag; value = (REAL) _value; save = 0; } }; -- cgit v1.2.3 From ba9dc26eec0ee65ea3aa1d8f8f31731157f86fa0 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 2 Jan 2010 15:29:25 -0800 Subject: glu/sgi: Initialize member of struct O_trim. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 48249466f36..14f07d3c15a 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -95,7 +95,7 @@ struct O_trim : public PooledObj { O_curve *o_curve; /* closed trim loop */ O_trim * next; /* next loop along trim */ int save; /* 1 if in display list */ - O_trim() { next = 0; o_curve = 0; } + O_trim() { next = 0; o_curve = 0; save = 0; } }; struct O_nurbssurface : public PooledObj { -- cgit v1.2.3 From 386f91eec3f96cb8e28dfc6545a11e1d7dedc22b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 2 Jan 2010 15:46:11 -0800 Subject: glu/sgi: Initialize members of struct O_surface. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 14f07d3c15a..3390ce80e99 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -114,7 +114,7 @@ struct O_surface : public PooledObj { O_trim * o_trim; /* list of trim loops */ int save; /* 1 if in display list */ long nuid; - O_surface() { o_trim = 0; o_nurbssurface = 0; } + O_surface() { o_trim = 0; o_nurbssurface = 0; save = 0; nuid = 0; } }; struct Property : public PooledObj { -- cgit v1.2.3 From fe27b07b0fe7b63755add9bf522d7efcbf1ffb9b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 2 Jan 2010 20:04:00 -0800 Subject: glu/sgi: Initialize members of struct O_curve. --- src/glu/sgi/libnurbs/internals/reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glu/sgi') diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 3390ce80e99..cae6cada468 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -64,7 +64,7 @@ struct O_curve : public PooledObj { int save; /* 1 if in display list */ long nuid; O_curve() { next = 0; used = 0; owner = 0; - curve.o_pwlcurve = 0; } + curve.o_pwlcurve = 0; curvetype = ct_none; save = 0; nuid = 0; } }; struct O_nurbscurve : public PooledObj { -- cgit v1.2.3