diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index c6da6cf15141e40a844513cf93c20e499f1e64ef..970b78140e89588ec52139b53d9484a2871e7b5e 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -1615,6 +1615,17 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
     CHECK(m_resChangeInClvsEnabled, "resolution change in CLVS and subpictures cannot be enabled together");
   }
 
+#if JVET_S0221_NUM_VB_CHECK
+  if (m_virtualBoundariesPresentFlag)
+  {
+    if (m_iSourceWidth <= 8)
+      CHECK(m_numVerVirtualBoundaries != 0, "The number of vertical virtual boundaries shall be 0 when the picture width is less than or equal to 8");
+
+    if (m_iSourceHeight <= 8)
+      CHECK(m_numHorVirtualBoundaries != 0, "The number of horizontal virtual boundaries shall be 0 when the picture height is less than or equal to 8");
+  }
+#endif
+
   if (m_cfgSubpictureLevelInfoSEI.m_enabled)
   {
     CHECK (m_numSubPics != m_cfgSubpictureLevelInfoSEI.m_numSubpictures, "NumSubPics must be equal to SEISubpicLevelInfoNumSubpics" );
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 587c845f546d9801ee2026d36daa0ab51be4efcc..28a9f88587452839ac5cd5126dc45f721b7df8d7 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -53,7 +53,7 @@
 
 //########### place macros to be removed in next cycle below this line ###############
 
-#define JVET_R0042_SUBPIC_CHECK                           1 // JVET_R0042: SubPicture types related constraints
+#define JVET_S0221_NUM_VB_CHECK                           1 // JVET_S0221: Constraints on the number of virtual boundaries
 
 
 //########### place macros to be be kept below this line ###############
diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index a526534e5ab71cd34da0787eff1903daef9180b9..5e750dd58a321da705449adff2e5e8f28fccf5fd 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -1873,7 +1873,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
 #if JVET_S0221_NUM_VB_CHECK
     if (pcSPS->getMaxPicWidthInLumaSamples() <= 8)
     {
-      CHECK(pcSPS->getNumVerVirtualBoundaries() == 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
+      CHECK(pcSPS->getNumVerVirtualBoundaries() != 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
     }
 #endif
     for( unsigned i = 0; i < pcSPS->getNumVerVirtualBoundaries(); i++ )
@@ -1884,7 +1884,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
 #if JVET_S0221_NUM_VB_CHECK
     if (pcSPS->getMaxPicHeightInLumaSamples() <= 8)
     {
-      CHECK(pcSPS->getNumHorVirtualBoundaries() == 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
+      CHECK(pcSPS->getNumHorVirtualBoundaries() != 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
     }
 #endif
     for( unsigned i = 0; i < pcSPS->getNumHorVirtualBoundaries(); i++ )
@@ -2594,7 +2594,7 @@ void HLSyntaxReader::parsePictureHeader( PicHeader* picHeader, ParameterSetManag
 #if JVET_S0221_NUM_VB_CHECK
       if (pps->getPicWidthInLumaSamples() <= 8)
       {
-        CHECK(picHeader->getNumVerVirtualBoundaries() == 0, "PH: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
+        CHECK(picHeader->getNumVerVirtualBoundaries() != 0, "PH: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
       }
 #endif
       for( unsigned i = 0; i < picHeader->getNumVerVirtualBoundaries(); i++ )
@@ -2605,7 +2605,7 @@ void HLSyntaxReader::parsePictureHeader( PicHeader* picHeader, ParameterSetManag
 #if JVET_S0221_NUM_VB_CHECK
       if (pps->getPicHeightInLumaSamples() <= 8)
       {
-        CHECK(picHeader->getNumHorVirtualBoundaries() == 0, "PH: When picture width is less than or equal to 8, the number of horizontal virtual boundaries shall be equal to 0");
+        CHECK(picHeader->getNumHorVirtualBoundaries() != 0, "PH: When picture width is less than or equal to 8, the number of horizontal virtual boundaries shall be equal to 0");
       }
 #endif
       for( unsigned i = 0; i < picHeader->getNumHorVirtualBoundaries(); i++ )
diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index 79f8ac65a780ad555b7c5c64b854efa4632b7ed2..71f55c30fc4d89e4c337bf7c65ec1f77ab221e57 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -1139,7 +1139,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
 #if JVET_S0221_NUM_VB_CHECK
       if (pcSPS->getMaxPicWidthInLumaSamples() <= 8)
       {
-        CHECK(pcSPS->getNumVerVirtualBoundaries() == 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
+        CHECK(pcSPS->getNumVerVirtualBoundaries() != 0, "SPS: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
       }
 #endif
       for( unsigned i = 0; i < pcSPS->getNumVerVirtualBoundaries(); i++ )
@@ -1150,7 +1150,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
 #if JVET_S0221_NUM_VB_CHECK
       if (pcSPS->getMaxPicHeightInLumaSamples() <= 8)
       {
-        CHECK(pcSPS->getNumHorVirtualBoundaries() == 0, "SPS: When picture height is less than or equal to 8, the number of horizontal virtual boundaries shall be equal to 0");
+        CHECK(pcSPS->getNumHorVirtualBoundaries() != 0, "SPS: When picture height is less than or equal to 8, the number of horizontal virtual boundaries shall be equal to 0");
       }
 #endif
       for( unsigned i = 0; i < pcSPS->getNumHorVirtualBoundaries(); i++ )
@@ -1595,7 +1595,7 @@ void HLSWriter::codePictureHeader( PicHeader* picHeader, bool writeRbspTrailingB
 #if JVET_S0221_NUM_VB_CHECK
       if (pps->getPicWidthInLumaSamples() <= 8)
       {
-        CHECK(picHeader->getNumVerVirtualBoundaries() == 0, "PH: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
+        CHECK(picHeader->getNumVerVirtualBoundaries() != 0, "PH: When picture width is less than or equal to 8, the number of vertical virtual boundaries shall be equal to 0");
       }
 #endif
       for( unsigned i = 0; i < picHeader->getNumVerVirtualBoundaries(); i++ )
@@ -1606,7 +1606,7 @@ void HLSWriter::codePictureHeader( PicHeader* picHeader, bool writeRbspTrailingB
 #if JVET_S0221_NUM_VB_CHECK
       if (pps->getPicHeightInLumaSamples() <= 8)
       {
-        CHECK(picHeader->getNumHorVirtualBoundaries() == 0, "PH: When picture width is less than or equal to 8, the number of horizontal virtual boundaries shall be equal to 0");
+        CHECK(picHeader->getNumHorVirtualBoundaries() != 0, "PH: When picture width is less than or equal to 8, the number of horizontal virtual boundaries shall be equal to 0");
       }
 #endif
       for( unsigned i = 0; i < picHeader->getNumHorVirtualBoundaries(); i++ )