Fix T66573 Heap Corruption when baking to irradiance volume probe

This is an AMD Proprietary driver bug. Will be reported upstream.
This commit is contained in:
Clément Foucault 2019-07-08 23:24:15 +02:00
parent 96f5918407
commit f04424a15d
Notes: blender-bot 2023-02-14 01:56:10 +01:00
Referenced by issue #66573, Debug Error: HEAP CORRUPTION DETECTED when baking to irradiance volume probe
1 changed files with 3 additions and 1 deletions

View File

@ -1459,7 +1459,9 @@ void *GPU_texture_read(GPUTexture *tex, eGPUDataFormat gpu_data_format, int mipl
break;
}
void *buf = MEM_mallocN(buf_size, "GPU_texture_read");
/* AMD Pro driver have a bug that write 2 bytes past buffer size
* if the texture is big. (see T66573) */
void *buf = MEM_mallocN(buf_size + 8, "GPU_texture_read");
GLenum data_format = gpu_get_gl_dataformat(tex->format, &tex->format_flag);
GLenum data_type = gpu_get_gl_datatype(gpu_data_format);