blob: 8332a1e84685486cb2e48e0b6e447dbbb0f819ae (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
From b4f435a4ecceba0ef3a785dbe8eead6f55f49cc1 Mon Sep 17 00:00:00 2001
From: Kevin Backhouse <kevinbackhouse@github.com>
Date: Sat, 17 Jun 2023 13:39:15 +0100
Subject: [PATCH] Avoid triggering assertion in std::vector::operator[]
(cherry picked from commit 3202e86e737ea181a1904c9d3b9a6b619c3baba5)
---
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()) {
|