Index: Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- Lib/TLibCommon/TComPrediction.cpp	(revision 4604)
+++ Lib/TLibCommon/TComPrediction.cpp	(working copy)
@@ -1101,12 +1101,25 @@
   bReusedPrev = (Bool*)xMalloc(Bool, uiMaxPLTPredSize + 1);
   memset(bPredicted, 0, sizeof(Bool)*(uiMaxPLTSize + 1));
   memset(bReusedPrev, 0, sizeof(Bool)*(uiMaxPLTPredSize + 1));
+
+#if FIX_PLT_REORDER
+  Int uiNumPLTRceived = uiDictMaxSize;
+  UInt uiNumPLTPredicted = 0;
+
+  for (uiIdxCurr = 0; uiIdxCurr < uiDictMaxSize; uiIdxCurr++)
+#else
   UInt uiNumPLTRceived = uiDictMaxSize, uiNumPLTPredicted = 0;
   for (uiIdxPrev = 0; uiIdxPrev < uiPLTSizePrev; uiIdxPrev++)
+#endif
   {
     bReused = false;
     Int iCounter = 0;
+
+#if FIX_PLT_REORDER
+    for (uiIdxPrev = 0; uiIdxPrev < uiPLTSizePrev; uiIdxPrev++)
+#else
     for (uiIdxCurr = 0; uiIdxCurr < uiDictMaxSize; uiIdxCurr++)
+#endif
     {
       iCounter = 0;
 
@@ -1131,6 +1144,12 @@
       uiNumPLTPredicted++;
     }
   }
+
+#if FIX_PLT_REORDER
+  assert( uiNumPLTRceived >= 0 );
+  assert( uiNumPLTPredicted <= uiDictMaxSize );
+#endif
+
   for (uiIdxPrev = 0; uiIdxPrev < uiMaxPLTPredSize; uiIdxPrev++)
   {
     for (UInt comp = compBegin; comp < compBegin + uiNumComp; comp++)
Index: Lib/TLibCommon/TypeDef.h
===================================================================
--- Lib/TLibCommon/TypeDef.h	(revision 4604)
+++ Lib/TLibCommon/TypeDef.h	(working copy)
@@ -45,6 +45,8 @@
 #include <vector>
 #include <cstdlib>
 
+#define FIX_PLT_REORDER         1
+
 //! \ingroup TLibCommon
 //! \{
 
