From cd073275848e2b775289db431c7febda9253ed5e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 26 Jul 2024 15:26:36 +0200 Subject: [PATCH] BLO write: Avoid double lookup in already added blocks addresses. --- source/blender/blenloader/intern/writefile.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/blender/blenloader/intern/writefile.cc b/source/blender/blenloader/intern/writefile.cc index 37857dd1798..73a75b129e8 100644 --- a/source/blender/blenloader/intern/writefile.cc +++ b/source/blender/blenloader/intern/writefile.cc @@ -700,13 +700,12 @@ static bool write_at_address_validate(WriteData *wd, int filecode, const void *a } if (wd->is_writing_id && filecode == BLO_CODE_DATA) { - if (wd->validation_data.per_id_addresses_set.contains(address)) { + if (!wd->validation_data.per_id_addresses_set.add(address)) { CLOG_ERROR(&LOG, "Same identifier (old address) used several times for a same ID, skipping this " "block to avoid critical corruption of the Blender file."); return false; } - wd->validation_data.per_id_addresses_set.add(address); } return true; }