Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1009)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1011)
@@ -2589,17 +2589,17 @@
     READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" );
     vps->setCrossLayerIrapAlignFlag(uiCode);
+#endif
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  }
+  else
+  {
+    vps->setCrossLayerIrapAlignFlag(true);
+  }
+#endif
 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
-    if( uiCode )
-    {
-      READ_FLAG( uiCode, "all_layers_idr_aligned_flag" );
-      vps->setCrossLayerAlignedIdrOnlyFlag(uiCode);
-    }
-#endif
-#endif
-#if O0223_PICTURE_TYPES_ALIGN_FLAG
-  }
-  else
-  {
-    vps->setCrossLayerIrapAlignFlag(true);
+  if( uiCode )
+  {
+    READ_FLAG( uiCode, "all_layers_idr_aligned_flag" );
+    vps->setCrossLayerAlignedIdrOnlyFlag(uiCode);
   }
 #endif
@@ -2779,7 +2779,7 @@
   {
 #if VPS_FIX_TO_MATCH_SPEC
-      for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++ )
-#else
-      for (i = 0; i < vps->getMaxLayers(); i++)
+    for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++ )
+#else
+    for (i = 0; i < vps->getMaxLayers(); i++)
 #endif
     {
