From b21a3d9eef0bc0c201ae8b15f2f8ed939dd5f739 Mon Sep 17 00:00:00 2001
From: Frank Bossen <fbossen@gmail.com>
Date: Wed, 29 Jul 2020 22:09:13 -0400
Subject: [PATCH] Fix parsing of APS after !1795

---
 source/Lib/DecoderLib/VLCReader.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 1cc4fada1..fabd1b69e 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -932,15 +932,17 @@ void HLSyntaxReader::parseAPS( APS* aps )
   aps->chromaPresentFlag = codeApsChromaPresentFlag;
 #endif
 
-  if( code == ALF_APS )
+  const ApsType apsType = aps->getAPSType();
+
+  if (apsType == ALF_APS)
   {
     parseAlfAps( aps );
   }
-  else if( code == LMCS_APS )
+  else if (apsType == LMCS_APS)
   {
     parseLmcsAps( aps );
   }
-  else if( code == SCALING_LIST_APS )
+  else if (apsType == SCALING_LIST_APS)
   {
     parseScalingListAps( aps );
   }
-- 
GitLab