[Bf-blender-cvs] [4f0ec3cea57] master: Cleanup: use pre-calculated size variable

Campbell Barton noreply at git.blender.org
Mon Sep 6 12:35:04 CEST 2021


Commit: 4f0ec3cea5732e5b06122519538488e104c7ff00
Author: Campbell Barton
Date:   Mon Sep 6 20:32:35 2021 +1000
Branches: master
https://developer.blender.org/rB4f0ec3cea5732e5b06122519538488e104c7ff00

Cleanup: use pre-calculated size variable

Oversight in a0912ff5663b950222ef00485a3853bfb6001db4

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

M	source/blender/imbuf/intern/allocimbuf.c

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

diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index c2bff9ddc51..1369f8cc0f8 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -484,7 +484,7 @@ struct ImBuf *IMB_allocFromBuffer(const unsigned int *rect,
   /* Avoid #MEM_dupallocN since the buffers might not be allocated using guarded-allocation. */
   if (rectf) {
     const size_t size = sizeof(float[4]) * w * h;
-    ibuf->rect_float = MEM_mallocN(sizeof(float[4]) * w * h, __func__);
+    ibuf->rect_float = MEM_mallocN(size, __func__);
     memcpy(ibuf->rect_float, rectf, size);
 
     ibuf->flags |= IB_rectfloat;



More information about the Bf-blender-cvs mailing list