diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2024-10-08 19:18:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-10-09 11:12:00 +0200 |
commit | a28f9a8cc21cf1ca6b552af64015a745c9a95b27 (patch) | |
tree | 74921e2063402b72eee70c5015221e325a48bfc4 /oox | |
parent | 4a4535300ebd146322bf7e788d0200e4b338f4ad (diff) |
cid#1607224 Overflowed return value
Change-Id: I62e153936f9f49fb12deee735ec665bad8a23ad7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174706
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/vml/vmldrawing.cxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 7d65872b4cf0..c44b9e426119 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -235,6 +235,7 @@ sal_Int32 Drawing::getLocalShapeIndex( std::u16string_view rShapeId ) const sal_Int32 nBlockId = (nShapeId - 1) / 1024; BlockIdVector::iterator aIt = ::std::lower_bound( maBlockIds.begin(), maBlockIds.end(), nBlockId ); sal_Int32 nIndex = static_cast< sal_Int32 >( aIt - maBlockIds.begin() ); + assert(nIndex < std::numeric_limits<sal_Int32>::max() / 1024 -1 && "possible overflow"); // block id not found in set -> register it now (value of nIndex remains valid) if( (aIt == maBlockIds.end()) || (*aIt != nBlockId) ) |