[Bf-blender-cvs] [5bfab333fdc] asset-engine: Add some more protection against invalid data from asset engine.

Bastien Montagne noreply at git.blender.org
Sat Aug 19 18:27:19 CEST 2017


Commit: 5bfab333fdce6457c150420baa4bdf0af4101b72
Author: Bastien Montagne
Date:   Sat Aug 19 18:21:01 2017 +0200
Branches: asset-engine
https://developer.blender.org/rB5bfab333fdce6457c150420baa4bdf0af4101b72

Add some more protection against invalid data from asset engine.

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

M	source/blender/editors/space_file/filelist.c

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

diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index a18bede1111..697113b0472 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1850,12 +1850,12 @@ static bool filelist_file_cache_block_create(FileList *filelist, const int start
 
 		entry = filelist_file_create_entries_block(filelist, start_index, size);
 
-		for (i = 0; i < size; i++, cursor++, entry = entry->next) {
+		for (i = 0; (i < size) && (entry != NULL); i++, cursor++, entry = entry->next) {
 //			printf("%d, %p\n", i, entry);
 			cache->block_entries[cursor] = entry;
 			BLI_ghash_insert(cache->uuids, entry->uuid, entry);
 		}
-		return true;
+		return (i == size);
 	}
 	else {
 		int i, idx;



More information about the Bf-blender-cvs mailing list