Merge branch 'bug/big-res-crashies'

This commit is contained in:
ktyl 2021-10-29 13:30:54 +01:00
commit 0cb47db342
1 changed files with 3 additions and 1 deletions

View File

@ -224,7 +224,7 @@ GLuint createNoiseTexture(int width, int height)
int length = width*height*channels;
printf("generating %d random floats\n", length);
float data[width*height*channels];
float* data = (float*)malloc(length*sizeof(float));
for (int i = 0; i < length; i++)
{
@ -235,6 +235,8 @@ GLuint createNoiseTexture(int width, int height)
glBindImageTexture(0, texture, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
glGenerateMipmap(GL_TEXTURE_2D);
free(data);
return texture;
}