Fix some issues from lates coverity scan.

Unlikely, but still valid.
This commit is contained in:
Bastien Montagne 2015-08-24 09:59:04 +02:00
parent 8031f36261
commit 8cc8ce3d46
2 changed files with 11 additions and 2 deletions

@ -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);

@ -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);