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 authored and neheb committed Jun 18, 2023
1 parent 33071f3 commit 3202e86
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 3202e86

Please sign in to comment.