diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-03-16 12:09:35 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-03-16 12:12:03 +0300 |
commit | 6d011d0e27d79b9c9fc7570770f5af958706e63a (patch) | |
tree | 9036203e1a9a5050114cdfccaebbbb871b9d588b /source/blender/blenkernel/intern/cryptomatte.cc | |
parent | cb3005c2633dc3bea328b67a075709a8a1824fdd (diff) |
Fix: Cryptomatte load corrupt manifests.
Seems like one of the example files on the cryptomatte github is
malformed and blender crashes when loading that file. This change will
try to load as much as possible from the manifest so it can still be
used.
This has also been reported to cryptomatte project.
Diffstat (limited to 'source/blender/blenkernel/intern/cryptomatte.cc')
-rw-r--r-- | source/blender/blenkernel/intern/cryptomatte.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cryptomatte.cc b/source/blender/blenkernel/intern/cryptomatte.cc index 74576b8bbbb..bc89fa85cea 100644 --- a/source/blender/blenkernel/intern/cryptomatte.cc +++ b/source/blender/blenkernel/intern/cryptomatte.cc @@ -410,6 +410,9 @@ static bool from_manifest(CryptomatteLayer &layer, blender::StringRefNull manife ref = ref.drop_prefix(quoted_name_len); ref = skip_whitespaces_(ref); + if (ref.is_empty()) { + return false; + } char colon = ref.front(); if (colon != ':') { return false; @@ -417,7 +420,7 @@ static bool from_manifest(CryptomatteLayer &layer, blender::StringRefNull manife ref = ref.drop_prefix(1); ref = skip_whitespaces_(ref); - if (ref.front() != '\"') { + if (ref.is_empty() || ref.front() != '\"') { return false; } |