Commit: 5dc9797f0b9f435126ca8bf0a16bbe1e11a1d0a2
Author: Brecht Van Lommel
Date:   Sun Jun 9 22:03:01 2019 +0200
Branches: master
https://developer.blender.org/rB5dc9797f0b9f435126ca8bf0a16bbe1e11a1d0a2

Fix T65657: crash in float texture painting, after recent changes

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

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

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

diff --git a/source/blender/gpu/intern/gpu_draw.c 
b/source/blender/gpu/intern/gpu_draw.c
index d3d7b3b7c1d..7813ae68371 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -400,7 +400,7 @@ static void gpu_texture_update_from_ibuf(Image *ima, ImBuf 
*ibuf, int x, int y,
     const bool store_premultiplied = (ima->alpha_mode != IMA_ALPHA_STRAIGHT);
 
     if (ibuf->channels != 4 || scaled || !store_premultiplied) {
-      rect_float = MEM_mallocN(sizeof(float) * 4 * x * y, __func__);
+      rect_float = MEM_mallocN(sizeof(float) * 4 * w * h, __func__);
       if (rect_float == NULL) {
         return;
       }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to