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:
authorLukas Tönne <lukas.toenne@gmail.com>2015-03-18 16:06:00 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-03-18 16:06:00 +0300
commit7c7d5645ca903b6ec013fae16709022733ce6b42 (patch)
tree82e2bbd142e9c054023fbc851e8981bff7ab06c9 /source/blender/editors
parent3079019ec1367f522ebd6de688044e1030832eff (diff)
Safeguard against crashes from invalid Alembic file paths by returning
NULL archive pointers. This allows writer/reader code to test against obvious archive errors easily and is unmistakable.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/io/io_cache_library.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/io/io_cache_library.c b/source/blender/editors/io/io_cache_library.c
index 8ae8655ee4b..87fe9d7dbd2 100644
--- a/source/blender/editors/io/io_cache_library.c
+++ b/source/blender/editors/io/io_cache_library.c
@@ -510,6 +510,11 @@ static int cache_library_archive_info_exec(bContext *C, wmOperator *op)
BKE_cache_archive_path(cachelib->filepath, (ID *)cachelib, cachelib->id.lib, filename, sizeof(filename));
archive = PTC_open_reader_archive(scene, filename);
+ if (!archive) {
+ BKE_reportf(op->reports, RPT_ERROR, "Cannot open cache file at '%s'", cachelib->filepath);
+ return OPERATOR_CANCELLED;
+ }
+
info = PTC_get_archive_info(archive);
PTC_close_reader_archive(archive);