Skip to content

Commit

Permalink
[Encode] fix coverity issue
Browse files Browse the repository at this point in the history
fix untrusted value as argument with early return
  • Loading branch information
DaShi-Git authored and intel-mediadev committed Oct 21, 2024
1 parent 8a867fa commit 105a308
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4321,7 +4321,8 @@ MOS_STATUS CodechalVdencAvcState::SetSliceStructs()
uint8_t swapIndex = CODEC_AVC_NUM_UNCOMPRESSED_SURFACE;
if (slcParams->num_ref_idx_l0_active_minus1 >= CODEC_MAX_NUM_REF_FIELD || slcParams->num_ref_idx_l1_active_minus1 >= CODEC_MAX_NUM_REF_FIELD)
{
eStatus = MOS_STATUS_INVALID_PARAMETER;
CODECHAL_ENCODE_ASSERTMESSAGE("Invalid slice parameters.");
return MOS_STATUS_INVALID_PARAMETER;
}

for (uint32_t sliceCount = 0; sliceCount < m_numSlices; sliceCount++)
Expand Down

0 comments on commit 105a308

Please sign in to comment.