Index: source/Lib/TLibCommon/TypeDef.h
===================================================================
--- source/Lib/TLibCommon/TypeDef.h	(revision 401)
+++ source/Lib/TLibCommon/TypeDef.h	(working copy)
@@ -317,6 +317,7 @@
 #define FIX_TICKET37                                      1  ///< Fix of ticket #37 (incorrect m_pppcPredYuvBest buffer copy)
 #define FIX_TICKET39                                      1  ///< Fix of ticket #39 (encoder bug of delta QP)
 #define FIX_TICKET40                                      1  ///< Fix of ticket #40 (ALF crash when image height is greater than image width)
+#define FIX_TICKET42                                      1  ///< Fix of ticket #42 (CTU bits/distortion calculation mistake for I slice when QTBT is enabled)
 
 ///////////////////////////////////////////////////////////
 // KTA tools section end
Index: source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- source/Lib/TLibEncoder/TEncCu.cpp	(revision 401)
+++ source/Lib/TLibEncoder/TEncCu.cpp	(working copy)
@@ -880,7 +880,19 @@
       }
 #endif
 
+#if FIX_TICKET42
+	  Double dLumaCTBTotalCost = pCtu->getTotalCost();
+	  Distortion dLumaCTBTotalDistortion = pCtu->getTotalDistortion();
+	  UInt uiLumaCTBTotalBits = pCtu->getTotalBits();
+	  UInt uiLumaCTBTotalBins = pCtu->getTotalBins();
+#endif
       xCompressCU( m_pppcBestCU[uiWidthIdx][uiHeightIdx], m_pppcTempCU[uiWidthIdx][uiHeightIdx], 0, uiCTUSize, uiCTUSize, 0 DEBUG_STRING_PASS_INTO(sDebug) );
+#if FIX_TICKET42
+	  pCtu->getTotalCost() += dLumaCTBTotalCost;
+	  pCtu->getTotalDistortion() += dLumaCTBTotalDistortion;
+	  pCtu->getTotalBits() += uiLumaCTBTotalBits;
+	  pCtu->getTotalBins() += uiLumaCTBTotalBins;
+#endif
     }
 #endif
 
