diff options
author | Jacques Lucke <jacques@blender.org> | 2021-01-26 19:49:58 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-01-26 19:49:58 +0300 |
commit | f22e85d72163a9649161dc550cb860f427a98111 (patch) | |
tree | dd13e0cb16f27c1c386aaeb2404ab0fa52115642 /source/blender/blenkernel/intern/customdata.c | |
parent | 31f568c33692e543fc84179c783870c20844c3d0 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 2 |
1 files changed, 1 insertions, 1 deletions
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."); |