diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index 1cb60edfd6e28056254b9703d2c679d4f3638475..fddfc8971df047afea025d9c9f91a3835007981f 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -1351,7 +1351,7 @@ void HLSWriter::codeVPS(const VPS* pcVPS)
         bool presentFlag = false;
         for (int j = 0; j < i; j++)
         {
-          presentFlag |= ((pcVPS->getMaxTidIlRefPicsPlus1(i, j) != 7) && pcVPS->getDirectRefLayerFlag(i, j));
+          presentFlag |= ((pcVPS->getMaxTidIlRefPicsPlus1(i, j) != MAX_TLAYER) && pcVPS->getDirectRefLayerFlag(i, j));
         }
         WRITE_FLAG(presentFlag, "max_tid_ref_present_flag[ i ]");
         for (int j = 0; j < i; j++)