Skip to content

Commit

Permalink
[Encode] Fix Coverity issues
Browse files Browse the repository at this point in the history
Refactor to avoid (1) unchecked return value; (2) nullptr dereference;
  • Loading branch information
perrchen authored and intel-mediadev committed Nov 22, 2023
1 parent dcb1d18 commit 625bce3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2250,7 +2250,7 @@ MOS_STATUS CodechalEncodeAvcBase::AllocateEncResources()
{
if (m_hmeKernel)
{
m_hmeKernel->AllocateResources();
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_hmeKernel->AllocateResources());
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ MOS_STATUS CodecHalHevcMbencG12::AllocateMeResources()
m_mvdistSummationSurfSize,
m_brcBuffers.mvAndDistortionSumSurface));
CmEvent *event = nullptr;
m_brcBuffers.mvAndDistortionSumSurface->InitSurface(0, event);
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_brcBuffers.mvAndDistortionSumSurface->InitSurface(0, event));
}
}
return MOS_STATUS_SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ CodechalVdencAvcStateG12::CodechalVdencAvcStateG12(

m_vdencBrcInitDmemBufferSize = sizeof(BrcInitDmem);
m_vdencBrcUpdateDmemBufferSize = sizeof(BrcUpdateDmem);
m_vdencBrcNumOfSliceOffset = MEDIA_IS_WA(m_waTable, Wa_22010554215) ? 0 : CODECHAL_OFFSETOF(BrcUpdateDmem, NumOfSlice);
m_vdencBrcNumOfSliceOffset = (m_waTable && MEDIA_IS_WA(m_waTable, Wa_22010554215)) ? 0 : CODECHAL_OFFSETOF(BrcUpdateDmem, NumOfSlice);

// One Gen12, avc vdenc ref index need to be one on one mapping
m_oneOnOneMapping = true;
Expand Down

0 comments on commit 625bce3

Please sign in to comment.