Skip to content

Commit

Permalink
Fix segfault in Filereader if directory does not exist.
Browse files Browse the repository at this point in the history
Signed-off-by: ptredak <ptredak@nvidia.com>
  • Loading branch information
ptrendx authored and JanuszL committed Aug 17, 2018
1 parent a66396e commit b5dd3e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dali/pipeline/operators/reader/loader/file_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ vector<std::pair<string, int>> traverse_directories(const std::string& path) {
// open the root
DIR *dir = opendir(path.c_str());

DALI_ENFORCE(dir != nullptr,
"Directory " + path + " could not be opened.");

struct dirent *entry;
int dir_count = 0;

Expand Down

0 comments on commit b5dd3e3

Please sign in to comment.