Skip to content

Commit

Permalink
Avoid triggering assertion in std::vector::operator[]
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse committed Jun 17, 2023
1 parent ec5fcd7 commit 5f9ecad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ byte* Exiv2::DataBuf::data(size_t offset) {
}

const byte* Exiv2::DataBuf::c_data(size_t offset) const {
if (pData_.empty()) {
if (pData_.empty() || offset == pData_.size()) {
return nullptr;
}
if (offset > pData_.size()) {
Expand Down

0 comments on commit 5f9ecad

Please sign in to comment.