[Bf-blender-cvs] [f22e85d7216] blender-v2.92-release: Fix T84935: improve previous fix for boolean custom data layers

Jacques Lucke noreply at git.blender.org
Tue Jan 26 17:50:20 CET 2021


Commit: f22e85d72163a9649161dc550cb860f427a98111
Author: Jacques Lucke
Date:   Tue Jan 26 17:49:58 2021 +0100
Branches: blender-v2.92-release
https://developer.blender.org/rBf22e85d72163a9649161dc550cb860f427a98111

Fix T84935: improve previous fix for boolean custom data layers

This improves the fix introduced in rBdc8b31af578bfcf9f77dbce6d7b7da1006a3c8c1.
While it did not result in other bugs afaik, I thought it would be
good to make the fix more specific, in case some other code did
expect `layer->data` to be null. This updated fix checks for the
very specific case the fix was intended for.

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

M	source/blender/blenkernel/intern/customdata.c

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

diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 446ef12574d..b0994fb683a 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -5197,7 +5197,7 @@ void CustomData_blend_read(BlendDataReader *reader, CustomData *data, int count)
 
     if (CustomData_verify_versions(data, i)) {
       BLO_read_data_address(reader, &layer->data);
-      if (layer->data == NULL) {
+      if (layer->data == NULL && count > 0 && layer->type == CD_PROP_BOOL) {
         /* Usually this should never happen, except when a custom data layer has not been written
          * to a file correctly. */
         CLOG_WARN(&LOG, "Reallocating custom data layer that was not saved correctly.");



More information about the Bf-blender-cvs mailing list