From ac87c3ff531a91b5f99c23f08c8572de04520d79 Mon Sep 17 00:00:00 2001 From: Christian Helmrich Date: Mon, 22 Jul 2019 17:17:16 +0200 Subject: [PATCH] prevent potential overflows in square(), fix suggested by A. Wieckowski --- source/Lib/CommonLib/TrQuant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Lib/CommonLib/TrQuant.cpp b/source/Lib/CommonLib/TrQuant.cpp index d633033..3206bef 100644 --- a/source/Lib/CommonLib/TrQuant.cpp +++ b/source/Lib/CommonLib/TrQuant.cpp @@ -84,7 +84,7 @@ InvTrans *fastInvTrans[NUM_TRANS_TYPE][g_numTransformMatrixSizes] = //! \{ #if JVET_O0105_ICT -int64_t square( int d ) { return d*d; } +static inline int64_t square( const int d ) { return d * (int64_t)d; } template std::pair fwdTransformCbCr( const PelBuf &resCb, const PelBuf &resCr, PelBuf& resC1, PelBuf& resC2 ) { -- GitLab