diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index c7e53fd557a20c9e0aaba6d335f46dfe5c007f57..3cc22c22b1f37e707a0c6c275ce6fda6a79cb6dd 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -2897,6 +2897,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" ); } } @@ -2940,6 +2943,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