Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw if open file with EXV_ENABLE_FILESYSTEM off (backport #3020) #3021

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/exiv2/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ enum class ErrorCode {
kerArithmeticOverflow,
kerMallocFailed,
kerInvalidIconvEncoding,
kerFileAccessDisabled,

kerErrorCount,
};
Expand Down
1 change: 1 addition & 0 deletions src/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ constexpr std::array errList{
N_("Arithmetic operation overflow"), // kerArithmeticOverflow
N_("Memory allocation failed"), // kerMallocFailed
N_("Cannot convert text encoding from '%1' to '%2'"), // kerInvalidIconvEncoding
N_("%1: File access disabled in exiv2 build options"), // kerFileOpenFailed %1=path
};
static_assert(errList.size() == static_cast<size_t>(Exiv2::ErrorCode::kerErrorCount),
"errList needs to contain a error msg for every ErrorCode defined in error.hpp");
Expand Down
2 changes: 1 addition & 1 deletion src/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ BasicIo::UniquePtr ImageFactory::createIo(const std::string& path, [[maybe_unuse

return std::make_unique<FileIo>(path);
#else
return nullptr;
throw Error(ErrorCode::kerFileAccessDisabled, path);
#endif
} // ImageFactory::createIo

Expand Down
Loading