Index: branches/HTM-11.0-dev0-Qualcomm/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-11.0-dev0-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 958)
+++ branches/HTM-11.0-dev0-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 959)
@@ -361,4 +361,5 @@
 
 #define H0044_POC_LSB_NOT_PRESENT        1      ///< JCT3V-H0044: Add constraint checking on the value of poc_reset_idc and poc_lsb_val
+#define H0056_EOS_CHECKS                 1      ///< JCT3V-H0056: Put checks on handling EOS
 
 /////////////////////////////////////////////////////////////////////////////////////////
Index: branches/HTM-11.0-dev0-Qualcomm/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/HTM-11.0-dev0-Qualcomm/source/Lib/TLibDecoder/TDecTop.cpp	(revision 958)
+++ branches/HTM-11.0-dev0-Qualcomm/source/Lib/TLibDecoder/TDecTop.cpp	(revision 959)
@@ -365,4 +365,7 @@
   m_prevSliceSkipped = false;
   m_skippedPOC = 0;
+#if H0056_EOS_CHECKS
+  m_isLastNALWasEos = false;
+#endif
 #if H_MV
   m_layerId = 0;
@@ -1209,4 +1212,7 @@
     case NAL_UNIT_VPS:
       xDecodeVPS();
+#if H0056_EOS_CHECKS
+      m_isLastNALWasEos = false;
+#endif
       return false;
       
@@ -1221,4 +1227,10 @@
     case NAL_UNIT_PREFIX_SEI:
     case NAL_UNIT_SUFFIX_SEI:
+#if H0056_EOS_CHECKS
+      if ( nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI )
+      {
+        assert( m_isLastNALWasEos == false );
+      }
+#endif
       xDecodeSEI( nalu.m_Bitstream, nalu.m_nalUnitType );
       return false;
@@ -1240,4 +1252,18 @@
     case NAL_UNIT_CODED_SLICE_RASL_N:
     case NAL_UNIT_CODED_SLICE_RASL_R:
+#if H0056_EOS_CHECKS
+      if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N ||
+          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N ||
+          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N ||
+          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
+          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N )
+      {
+        assert( m_isLastNALWasEos == false );
+      }
+      else
+      {
+        m_isLastNALWasEos = false;
+      }
+#endif
 #if H_MV
       return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag );
@@ -1247,4 +1273,14 @@
       break;
     case NAL_UNIT_EOS:
+#if H0056_EOS_CHECKS
+      assert( m_isLastNALWasEos == false );
+      //Check layer id of the nalu. if it is not 0, give a warning message and just return without doing anything.
+      if (nalu.m_layerId > 0)
+      {
+        printf( "\nThis bitstream has EOS with non-zero layer id.\n" );
+        return false;
+      }
+      m_isLastNALWasEos = true;
+#endif
       m_associatedIRAPType = NAL_UNIT_INVALID;
       m_pocCRA = 0;
@@ -1264,4 +1300,9 @@
       return false;
       
+#if H0056_EOS_CHECKS
+    case NAL_UNIT_FILLER_DATA:
+      assert( m_isLastNALWasEos == false );
+      return false;
+#endif
       
     case NAL_UNIT_RESERVED_VCL_N10:
@@ -1284,5 +1325,7 @@
     case NAL_UNIT_RESERVED_VCL31:
       
+#if !H0056_EOS_CHECKS
     case NAL_UNIT_FILLER_DATA:
+#endif
     case NAL_UNIT_RESERVED_NVCL41:
     case NAL_UNIT_RESERVED_NVCL42:
Index: branches/HTM-11.0-dev0-Qualcomm/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- branches/HTM-11.0-dev0-Qualcomm/source/Lib/TLibDecoder/TDecTop.h	(revision 958)
+++ branches/HTM-11.0-dev0-Qualcomm/source/Lib/TLibDecoder/TDecTop.h	(revision 959)
@@ -226,4 +226,8 @@
   Int                     m_skippedPOC;
 
+#if H0056_EOS_CHECKS
+  Bool                    m_isLastNALWasEos;
+#endif
+
 #if H_MV
   // For H_MV m_bFirstSliceInSequence indicates first slice in sequence of the particular layer  
