From d33a7f5a6da37f265498b80d04393cce93b9814d Mon Sep 17 00:00:00 2001 From: Frank Bossen <fbossen@gmail.com> Date: Thu, 15 Nov 2018 15:39:52 -0500 Subject: [PATCH] Avoid using uninitialized memory Fixes #108 --- source/Lib/CommonLib/IntraPrediction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Lib/CommonLib/IntraPrediction.cpp b/source/Lib/CommonLib/IntraPrediction.cpp index 8e8a5178e..6f8c41ef4 100644 --- a/source/Lib/CommonLib/IntraPrediction.cpp +++ b/source/Lib/CommonLib/IntraPrediction.cpp @@ -898,7 +898,7 @@ void IntraPrediction::xPredIntraAng( const CPelBuf &pSrc, PelBuf &pDst, const Ch p[0] = refMain[refMainIndex - 1]; p[1] = refMain[refMainIndex]; p[2] = refMain[refMainIndex + 1]; - p[3] = refMain[refMainIndex + 2]; + p[3] = f[3] != 0 ? refMain[refMainIndex + 2] : 0; pDstBuf[y*dstStride + x] = static_cast<Pel>((static_cast<int>(f[0] * p[0]) + static_cast<int>(f[1] * p[1]) + static_cast<int>(f[2] * p[2]) + static_cast<int>(f[3] * p[3]) + 32) >> 6); -- GitLab