hwpfilter/source/hgzip.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
New commits: commit a2634d526e80236bfc0f925192f4a7201835f74f Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Aug 26 08:35:09 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Aug 28 13:13:43 2024 +0200 cid#1616925 Unintended sign extension Change-Id: Ifdcd817fe8b10a8eee6a8fabf767fdc1b311f800 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172516 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/hwpfilter/source/hgzip.cxx b/hwpfilter/source/hgzip.cxx index 451a8e8a3773..b1e96f9ba807 100644 --- a/hwpfilter/source/hgzip.cxx +++ b/hwpfilter/source/hgzip.cxx @@ -19,6 +19,7 @@ #include "precompile.h" +#include <sal/types.h> #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -260,9 +261,9 @@ int gz_flush(gz_stream * file, int flush) static bool getLongEquals(gz_stream* s, uLong val) { uLong x = get_byte(s); - x += get_byte(s) << 8; - x += get_byte(s) << 16; - x += get_byte(s) << 24; + x += static_cast<sal_uInt32>(get_byte(s)) << 8; + x += static_cast<sal_uInt32>(get_byte(s)) << 16; + x += static_cast<sal_uInt32>(get_byte(s)) << 24; if (s->z_eof) { s->z_err = Z_DATA_ERROR;