[Encoder] add input parameter check as protection for an encoder interface
Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -3427,6 +3427,10 @@ int32_t ForceCodingIDR (sWelsEncCtx* pCtx) { · 3426 unmodified lines | |||
| 3427 | } | 3427 | } |
| 3428 | 3428 | ||
| 3429 | int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) { | 3429 | int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) { |
| 3430 | if (NULL == pCtx || NULL == pDst) { | ||
| 3431 | return ENC_RETURN_UNEXPECTED; | ||
| 3432 | } | ||
| 3433 | |||
| 3430 | SFrameBSInfo* pFbi = (SFrameBSInfo*)pDst; | 3434 | SFrameBSInfo* pFbi = (SFrameBSInfo*)pDst; |
| 3431 | SLayerBSInfo* pLayerBsInfo = &pFbi->sLayerInfo[0]; | 3435 | SLayerBSInfo* pLayerBsInfo = &pFbi->sLayerInfo[0]; |
| 3432 | int32_t iCountNal = 0; | 3436 | int32_t iCountNal = 0; |