--- lib/database/src/so/elements/SoGLTextureImageElement.c++	Tue May 29 18:48:20 2001
+++ lib/database/src/so/elements/SoGLTextureImageElement.c++.new	Fri Aug 19 01:21:23 2005
@@ -424,8 +424,9 @@
     
     GLubyte *level0 = NULL;
     if (newSize != size) {
-	level0 = (GLubyte *)
-	    alloca(newSize[0]*newSize[1]*numComponents*sizeof(GLubyte));
+	//level0 = (GLubyte *)
+	//    alloca(newSize[0]*newSize[1]*numComponents*sizeof(GLubyte));
+	level0 = new unsigned char[newSize[0]*newSize[1]*numComponents];
 
 	// Use gluScaleImage (which does linear interpolation or box
 	// filtering) if using a linear interpolation magnification
@@ -448,8 +449,9 @@
 	
 	const GLubyte *prevLevel = NULL;
 	if (level0 == NULL) {
-	    level0 = (GLubyte *)
-		alloca(newSize[0]*newSize[1]*numComponents*sizeof(GLubyte));
+	    //level0 = (GLubyte *)
+		//alloca(newSize[0]*newSize[1]*numComponents*sizeof(GLubyte));
+		level0 = new unsigned char[newSize[0]*newSize[1]*numComponents];
 	    prevLevel = bytes;
 	}
 	else {
@@ -511,4 +513,6 @@
     }
 
     glPixelStorei(GL_UNPACK_ALIGNMENT, 4);  // Reset to default
+        if (level0 != NULL)
+	   delete [] level0;
 }
