Index: branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 534)
+++ branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 535)
@@ -973,11 +973,12 @@
   Void    setSubLayerDpbInfoPresentFlag(Int i, Int j, Bool x) {m_subLayerDpbInfoPresentFlag[i][j] = x;    }
 
-  Int     getMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j)         { return m_maxVpsDecPicBufferingMinus1[i][k][j]; }
+  // For the 0-th output layer set, use the date from the active SPS for base layer.
+  Int     getMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j)         { assert(i != 0); return m_maxVpsDecPicBufferingMinus1[i][k][j]; }
   Void    setMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j, Int x) { m_maxVpsDecPicBufferingMinus1[i][k][j] = x;    }
 
-  Int     getMaxVpsNumReorderPics(Int i, Int j)         { return m_maxVpsNumReorderPics[i][j]; }
+  Int     getMaxVpsNumReorderPics(Int i, Int j)         { assert(i != 0); return m_maxVpsNumReorderPics[i][j]; }
   Void    setMaxVpsNumReorderPics(Int i, Int j, Int x) { m_maxVpsNumReorderPics[i][j] = x;    }
 
-  Int     getMaxVpsLatencyIncreasePlus1(Int i, Int j)         { return m_maxVpsLatencyIncreasePlus1[i][j]; }
+  Int     getMaxVpsLatencyIncreasePlus1(Int i, Int j)         { assert(i != 0); return m_maxVpsLatencyIncreasePlus1[i][j]; }
   Void    setMaxVpsLatencyIncreasePlus1(Int i, Int j, Int x) { m_maxVpsLatencyIncreasePlus1[i][j] = x;    }
 
Index: branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 534)
+++ branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 535)
@@ -178,7 +178,15 @@
     {
 #if USE_DPB_SIZE_TABLE
-      TComVPS *vps = slice->getVPS();
-      // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
-      numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer);
+      if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
+      {
+        assert( this->getLayerId() == 0 );
+        numReorderPics[temporalLayer] = pcSPS->getNumReorderPics(temporalLayer);
+      }
+      else
+      {
+        TComVPS *vps = slice->getVPS();
+        // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
+        numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer);
+      }
 #else
       numReorderPics[temporalLayer] = pcSPS->getNumReorderPics(temporalLayer);
@@ -274,7 +282,15 @@
   {
 #if USE_DPB_SIZE_TABLE
-    TComVPS *vps = pcSlice->getVPS();
-    // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
-    numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer);
+    if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
+    {
+      assert( this->getLayerId() == 0 );
+      numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer);
+    }
+    else
+    {
+      TComVPS *vps = pcSlice->getVPS();
+      // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
+      numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer);
+    }
 #else
     numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer);
@@ -283,5 +299,13 @@
 
 #if USE_DPB_SIZE_TABLE
-  m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
+  if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
+  {
+    assert( this->getLayerId() == 0 );
+    m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer());     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
+  }
+  else
+  {
+    m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
+  }
 #else
   m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer());     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
