From 51f3464570b07bc3b5cb7a6177727393c55a39f6 Mon Sep 17 00:00:00 2001 From: yuchisu <yu-chi.su@mediatek.com> Date: Fri, 26 Oct 2018 13:56:20 +0800 Subject: [PATCH] Fix uninitialized variables --- source/Lib/CommonLib/MotionInfo.h | 2 +- source/Lib/CommonLib/Unit.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/Lib/CommonLib/MotionInfo.h b/source/Lib/CommonLib/MotionInfo.h index 26fcb5a712..b46628e1b8 100644 --- a/source/Lib/CommonLib/MotionInfo.h +++ b/source/Lib/CommonLib/MotionInfo.h @@ -162,7 +162,7 @@ public: } Mv* pAffineMv = &(m_mvAffine[0][0][0][0]); - for (int ui = 0; ui < 2 * 2 * 33 * 3; ++ui, ++pMv) + for (int ui = 0; ui < 2 * 2 * 33 * 3; ++ui, ++pAffineMv) { pAffineMv->set(0, 0); } diff --git a/source/Lib/CommonLib/Unit.cpp b/source/Lib/CommonLib/Unit.cpp index 6152c93f57..3c21d11bcc 100644 --- a/source/Lib/CommonLib/Unit.cpp +++ b/source/Lib/CommonLib/Unit.cpp @@ -268,6 +268,8 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other ) imvNumCand = other.imvNumCand; #if JVET_L0646_GBI GBiIdx = other.GBiIdx; + for (int i = 0; i<2; i++) + refIdxBi[i] = other.refIdxBi[i]; #endif return *this; } @@ -297,6 +299,8 @@ void CodingUnit::initData() imvNumCand = 0; #if JVET_L0646_GBI GBiIdx = GBI_DEFAULT; + for (int i = 0; i < 2; i++) + refIdxBi[i] = -1; #endif } -- GitLab