ref: 0bae0f869a1f2aa11dc75fedac5bb36a94a87d46
parent: 24cd934ba95bed942f56dd5b864b205d179f797d
author: Martin Storsjö <martin@martin.st>
date: Fri Nov 28 08:06:41 EST 2014
Validate that iLoopFilterDisableIdc is set to a sensible value in ParamValidationExt In WelsEncoderParamAdjust it is already clipped in the same way, but here we should probably rather error out than to silently clip it to the right range.
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -261,6 +261,12 @@
pCodingParam->uiIntraPeriod, pCodingParam->uiGopSize);
return ENC_RETURN_UNSUPPORTED_PARA;
}
+ if (pCodingParam->iLoopFilterDisableIdc < 0 || pCodingParam->iLoopFilterDisableIdc > 6) {
+ WelsLog (pLogCtx, WELS_LOG_ERROR,
+ "ParamValidationExt(), iLoopFilterDisableIdc(%d) must be between 0 and 6",
+ pCodingParam->iLoopFilterDisableIdc);
+ return ENC_RETURN_UNSUPPORTED_PARA;
+ }
//about iMultipleThreadIdc, bDeblockingParallelFlag, iLoopFilterDisableIdc, & uiSliceMode