[Bf-blender-cvs] [5f52684a0f1] master: Initialize the fourth and final instance variable of MemoryProxy

Michael noreply at git.blender.org
Wed Dec 15 15:46:29 CET 2021


Commit: 5f52684a0f13bf265308af299b9e23214f3d2300
Author: Michael
Date:   Wed Dec 15 15:45:50 2021 +0100
Branches: master
https://developer.blender.org/rB5f52684a0f13bf265308af299b9e23214f3d2300

Initialize the fourth and final instance variable of MemoryProxy

The constructor of MemoryProxy initializes 3 of 4 instances variables.
If a MemoryProxy is constructed and MemoryProxy::free is called
on this instance, buffer_ is undefined and 'delete buffer_;' causes errors.

Although this misuse pattern does not exist in the current codebase
it already tripped up the Address Sanitizer on various occasions
while debugging unrelated problems.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D13569

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

M	source/blender/compositor/intern/COM_MemoryProxy.cc

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

diff --git a/source/blender/compositor/intern/COM_MemoryProxy.cc b/source/blender/compositor/intern/COM_MemoryProxy.cc
index 895990bc87f..6263c47fc9e 100644
--- a/source/blender/compositor/intern/COM_MemoryProxy.cc
+++ b/source/blender/compositor/intern/COM_MemoryProxy.cc
@@ -25,6 +25,7 @@ MemoryProxy::MemoryProxy(DataType datatype)
 {
   write_buffer_operation_ = nullptr;
   executor_ = nullptr;
+  buffer_ = nullptr;
   datatype_ = datatype;
 }



More information about the Bf-blender-cvs mailing list