diff --git a/source/Lib/CommonLib/Buffer.cpp b/source/Lib/CommonLib/Buffer.cpp
index 905d18bb225329a19de54ea48d10039d892ef7af..b691f54e418e4ca15cce115389caf677a5c4655b 100644
--- a/source/Lib/CommonLib/Buffer.cpp
+++ b/source/Lib/CommonLib/Buffer.cpp
@@ -787,7 +787,7 @@ PelBuf PelStorage::getBuf( const CompArea &blk )
 {
   const PelBuf& r = bufs[blk.compID];
 
-  //CHECKD( rsAddr( blk.bottomRight(), r.stride ) >= ( ( r.height - 1 ) * r.stride + r.width ), "Trying to access a buf outside of bound!" );
+  CHECKD( rsAddr( blk.bottomRight(), r.stride ) >= ( ( r.height - 1 ) * r.stride + r.width ), "Trying to access a buf outside of bound!" );
 
   return PelBuf( r.buf + rsAddr( blk, r.stride ), r.stride, blk );
 }
diff --git a/source/Lib/CommonLib/NNFilterUnified.cpp b/source/Lib/CommonLib/NNFilterUnified.cpp
index 05086220444c7089367f3e9ac0a260d68d273110..77af3f4f0bb9c57bad6660412a8e7ba147ed7c7d 100644
--- a/source/Lib/CommonLib/NNFilterUnified.cpp
+++ b/source/Lib/CommonLib/NNFilterUnified.cpp
@@ -589,7 +589,9 @@ void NNFilterUnified::filterBlock(Picture &pic, UnitArea inferArea, int extLeft,
 
   NNInference::infer<TypeSadlLFUnified>(model, m_inputs);
 
-  PelUnitBuf bufDst = m_scaled[0][prmId].getBuf(inferArea);
+  UnitArea inferAreaNoExt(inferArea.chromaFormat, Area(inferArea.lx() + extLeft, inferArea.ly() + extTop, inferArea.lwidth() - extLeft - extRight, inferArea.lheight() - extTop - extBottom));
+  UnitArea InferAreaExt(inferArea.chromaFormat, Area(-extLeft, -extTop, inferArea.lwidth(), inferArea.lheight()));
+  PelUnitBuf bufDst = m_scaled[0][prmId].getBuf(inferAreaNoExt).subBuf(InferAreaExt);
 
 #if JVET_AH0080_TRANS_INPUT
   if (m_nnlfTransInput) {