xmloff/source/draw/shapeexport.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit b904816f7375ef63c6c86578bed58f8dc06b6125 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Jul 13 19:54:29 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Jul 14 15:13:47 2024 +0200 cid#1608584 Overflowed constant Change-Id: Ieefa43899f84938ba12227b30a2c9b273ac2c202 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170437 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 9463b3e64eb8..65709b7bfba3 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2416,9 +2416,9 @@ OUString getNameFromStreamURL(std::u16string_view rURL) if (o3tl::starts_with(rURL, sPackageURL)) { std::u16string_view sRequestedName = rURL.substr(sPackageURL.size()); - size_t nLastIndex = sRequestedName.rfind('/') + 1; - if ((nLastIndex > 0) && (nLastIndex < sRequestedName.size())) - sRequestedName = sRequestedName.substr(nLastIndex); + size_t nLastIndex = sRequestedName.rfind('/'); + if (nLastIndex != std::u16string_view::npos && nLastIndex + 1 < sRequestedName.size()) + sRequestedName = sRequestedName.substr(nLastIndex + 1); nLastIndex = sRequestedName.rfind('.'); if (nLastIndex != std::u16string_view::npos) sRequestedName = sRequestedName.substr(0, nLastIndex);