Skip to content

Commit 3202e86

Browse files
kevinbackhouseneheb
authored andcommitted
Avoid triggering assertion in std::vector::operator[]
1 parent 33071f3 commit 3202e86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ byte* Exiv2::DataBuf::data(size_t offset) {
173173
}
174174

175175
const byte* Exiv2::DataBuf::c_data(size_t offset) const {
176-
if (pData_.empty()) {
176+
if (pData_.empty() || offset == pData_.size()) {
177177
return nullptr;
178178
}
179179
if (offset > pData_.size()) {

0 commit comments

Comments
 (0)