diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index cb826e718044c706b6d68a68ce825d8297fb13ec..8d4486950ebab0a99e05a650035c31ba634545c3 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -2869,6 +2869,9 @@ void HLSyntaxReader::alfFilter( AlfParam& alfParam, const bool isChroma ) #else coeff[ind * MAX_NUM_ALF_LUMA_COEFF + i] = alfGolombDecode( kMinTab[alfShape.golombIdx[i]] ); #endif + CHECK( isChroma && + ( coeff[ind * MAX_NUM_ALF_LUMA_COEFF + i] > 127 || coeff[ind * MAX_NUM_ALF_LUMA_COEFF + i] < -127 ) + , "AlfCoeffC shall be in the range of −127 to 127, inclusive" ); } } @@ -2912,6 +2915,8 @@ void HLSyntaxReader::alfFilter( AlfParam& alfParam, const bool isChroma ) } } #endif + CHECK( std::any_of( recCoeff, recCoeff + numFilters * MAX_NUM_ALF_LUMA_COEFF, [](short c) {return (c <-128 || c > 127);} ) + , "AlfCoeffL shall be in the range of −128 to 127, inclusive" ); } #endif