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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-08-24 10:59:04 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-08-24 10:59:50 +0300
commit8cc8ce3d466126b68b2a73f0491c332526b01fe0 (patch)
tree8e6f723f6ae8aab5a8a438701ebbf7eeb794dc50 /source/blender/editors
parent8031f36261df03d380a3aeb9fe52ec8bc54bacd9 (diff)
Fix some issues from lates coverity scan.
Unlikely, but still valid.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_file/file_ops.c6
-rw-r--r--source/blender/editors/space_file/filelist.c7
2 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index e1a0ee5edd2..7736a814efe 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -1275,10 +1275,14 @@ int file_exec(bContext *C, wmOperator *exec_op)
/* directory change */
if (file && (file->typeflag & FILE_TYPE_DIR)) {
+ if (!file->relpath) {
+ return OPERATOR_CANCELLED;
+ }
+
if (FILENAME_IS_PARENT(file->relpath)) {
BLI_parent_dir(sfile->params->dir);
}
- else if (file->relpath) {
+ else {
BLI_cleanup_dir(G.main->name, sfile->params->dir);
strcat(sfile->params->dir, file->relpath);
BLI_add_slash(sfile->params->dir);
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index c9133e803dd..0a9bb40a7cd 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1842,9 +1842,14 @@ bool filelist_cache_previews_update(FileList *filelist)
while (!BLI_thread_queue_is_empty(cache->previews_done)) {
FileListEntryPreview *preview = BLI_thread_queue_pop(cache->previews_done);
+ FileDirEntry *entry;
+ /* Paranoid (should never happen currently since we consume this queue from a single thread), but... */
+ if (!preview) {
+ continue;
+ }
/* entry might have been removed from cache in the mean while, we do not want to cache it again here. */
- FileDirEntry *entry = filelist_file_ex(filelist, preview->index, false);
+ entry = filelist_file_ex(filelist, preview->index, false);
// printf("%s: %d - %s - %p\n", __func__, preview->index, preview->path, preview->img);