Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1075)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1076)
@@ -2908,12 +2908,12 @@
   }
 
-  if( params->getTargetLayerId() > vps->getMaxLayerId() )
-  {
-    printf( "Warning: specified target layerId %d is greater than max layerId %d. Target layerId is set equal to max layerId %d.\n", params->getTargetLayerId(), vps->getMaxLayerId(), vps->getMaxLayerId() );
-    params->setTargetLayerId( vps->getMaxLayerId() );
-  }
-
   if( params->getTargetOutputLayerSetIdx() == -1 )  // Output layer set index not specified
   {
+    if( params->getTargetLayerId() > vps->getMaxLayerId() )
+    {
+      printf( "Warning: specified target layerId %d is greater than max layerId %d. Target layerId is set equal to max layerId %d.\n", params->getTargetLayerId(), vps->getMaxLayerId(), vps->getMaxLayerId() );
+      params->setTargetLayerId( vps->getMaxLayerId() );
+    }
+
     Bool layerSetMatchFound = false;
     // Output layer set index not assigned.
