diff --git a/source/Lib/CommonLib/IntraPrediction.cpp b/source/Lib/CommonLib/IntraPrediction.cpp
index 8e8a5178eeae6c3ce6355cf84b8e606407931dc5..6f8c41ef473662bd0aa99fa821dedffda2ec8089 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);