diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp
index 508360570e7dc38216653192fa4cd077966c6575..f8bfd4c081d02e0b07ab84de65e6814d8b85f7cf 100644
--- a/source/Lib/EncoderLib/EncCu.cpp
+++ b/source/Lib/EncoderLib/EncCu.cpp
@@ -1004,6 +1004,14 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par
   }
 
 #endif
+  if( tempCS->cost == MAX_DOUBLE && bestCS->cost == MAX_DOUBLE )
+  {
+    //although some coding modes were planned to be tried in RDO, no coding mode actually finished encoding due to early termination
+    //thus tempCS->cost and bestCS->cost are both MAX_DOUBLE; in this case, skip the following process for normal case
+    m_modeCtrl->finishCULevel( partitioner );
+    return;
+  }
+
   // set context states
   m_CABACEstimator->getCtx() = m_CurrCtx->best;