From 5f9ecada11ec9b3a599cd97872bcd73dab066c29 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Sat, 17 Jun 2023 13:39:15 +0100 Subject: [PATCH] Avoid triggering assertion in std::vector::operator[] --- src/types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.cpp b/src/types.cpp index 6559e20f4d..1c6963cda4 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -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()) {