Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-03-02 18:20:00 +0300
committerJeroen Bakker <jeroen@blender.org>2021-03-02 18:21:31 +0300
commit7f3649874070de38131263317d02906d50279f93 (patch)
tree9d1a27e88a29ec84519d2b785554f00c22cf273e /source/blender/blenkernel/intern/cryptomatte_test.cc
parentb3886c1f2adfb2d63b471d137bd7b42b68fbfb1d (diff)
Fix T86026: Crash Opening Cryptomatte File.
Not sure this fixes the root cause. It seems that memory corruption happens in dynstr. This patch replaces dynstr with a streamstring.
Diffstat (limited to 'source/blender/blenkernel/intern/cryptomatte_test.cc')
-rw-r--r--source/blender/blenkernel/intern/cryptomatte_test.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/cryptomatte_test.cc b/source/blender/blenkernel/intern/cryptomatte_test.cc
index d9be252d654..5481b97913c 100644
--- a/source/blender/blenkernel/intern/cryptomatte_test.cc
+++ b/source/blender/blenkernel/intern/cryptomatte_test.cc
@@ -21,6 +21,8 @@
#include "BKE_cryptomatte.hh"
#include "BKE_image.h"
+#include "DNA_node_types.h"
+
#include "RE_pipeline.h"
#include "MEM_guardedalloc.h"
@@ -176,4 +178,15 @@ TEST(cryptomatte, session_from_stamp_data)
BKE_cryptomatte_free(session);
}
+TEST(cryptomatte, T86026)
+{
+ NodeCryptomatte storage = {{0.0f}};
+ CryptomatteEntry entry = {nullptr};
+ BLI_addtail(&storage.entries, &entry);
+ entry.encoded_hash = 4.76190593e-07;
+ char *matte_id = BKE_cryptomatte_entries_to_matte_id(&storage);
+ EXPECT_STREQ("<4.761905927e-07>", matte_id);
+ MEM_freeN(matte_id);
+}
+
} // namespace blender::bke::cryptomatte::tests