/* gcc -Wall -Wextra -g3 -lglut -lGL test_program.c -o test_program */ #define GL_GLEXT_PROTOTYPES #include #include #include int main(int argc, char* argv[]) { char* buf; GLuint tex; glutInitDisplayMode( GLUT_RGBA ); glutInit( &argc, argv ); glutCreateWindow( "glGenerateMipmap crash" ); buf = calloc( 128*128*4*2, 1); glGenTextures( 1, &tex ); glBindTexture( GL_TEXTURE_2D_ARRAY, tex ); glTexImage3D( GL_TEXTURE_2D_ARRAY , 0 , GL_COMPRESSED_RGB , 128 , 128 , 2 , 0 , GL_RGBA , GL_UNSIGNED_BYTE , buf ); glGenerateMipmap( GL_TEXTURE_2D_ARRAY ); /* crash */ return 0; }