[Bf-blender-cvs] [f04424a15d9] master: Fix T66573 Heap Corruption when baking to irradiance volume probe

Clément Foucault noreply at git.blender.org
Mon Jul 8 23:52:09 CEST 2019


Commit: f04424a15d9c0f461f9c2f385696716d830b07f4
Author: Clément Foucault
Date:   Mon Jul 8 23:24:15 2019 +0200
Branches: master
https://developer.blender.org/rBf04424a15d9c0f461f9c2f385696716d830b07f4

Fix T66573 Heap Corruption when baking to irradiance volume probe

This is an AMD Proprietary driver bug. Will be reported upstream.

===================================================================

M	source/blender/gpu/intern/gpu_texture.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 6a92832d1e5..cd98da69469 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -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);



More information about the Bf-blender-cvs mailing list