writerperfect/source/common/WPXSvInputStream.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit bf1e649e6f626268db99d20ae921669ed557c3af Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Aug 23 17:18:41 2023 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Aug 24 10:03:53 2023 +0200 cid#1541185 Operands don't affect result when sal_Int64 == long Change-Id: I36fab92613a2e7dd8f3817b151e9a836b29803f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156014 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx index 2bcef2b52824..ded992e69c5c 100644 --- a/writerperfect/source/common/WPXSvInputStream.cxx +++ b/writerperfect/source/common/WPXSvInputStream.cxx @@ -441,8 +441,12 @@ tools::Long WPXSvInputStream::tellImpl() else { const sal_Int64 tmpPosition = mxSeekable->getPosition(); - if ((tmpPosition < 0) || (tmpPosition > LONG_MAX)) + if (tmpPosition < 0) return -1; +#if SAL_TYPES_SIZEOFLONG == 4 + if (tmpPosition > LONG_MAX) + return -1; +#endif return static_cast<tools::Long>(tmpPosition); } }