Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Commit

Permalink
[samples][AVC FEI] Fix the logic of null-pointer check
Browse files Browse the repository at this point in the history
(cherry picked from commit 18881db)
  • Loading branch information
atyugina authored and Oleg Nabiullin committed Jan 21, 2019
1 parent 5222b8f commit df84a2a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions samples/sample_fei/src/fei_encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,19 +689,19 @@ mfxStatus FEI_EncodeInterface::EncodeOneFrame(iTask* eTask)
{
MFX_ITT_TASK("EncodeOneFrame");

MSDK_CHECK_POINTER(eTask, MFX_ERR_NULL_PTR);

mfxStatus sts = MFX_ERR_NONE;

// ENC_in.InSurface always holds full-res surface
mfxFrameSurface1* encodeSurface = eTask->ENC_in.InSurface;
// ENC_in.InSurface always holds full-res surface.
// eTask=NULL is valid for the case of draining encoder frames when input is in display order.
mfxFrameSurface1* encodeSurface = eTask ? eTask->ENC_in.InSurface : nullptr;
if (encodeSurface) // no need to do this for buffered frames
{
sts = InitFrameParams(eTask);
MSDK_CHECK_STATUS(sts, "FEI ENCODE: InitFrameParams failed");
}

int numberOfCalls = (m_bSingleFieldMode && eTask->m_fieldPicFlag) ? 2 : 1;
int numberOfCalls = (m_bSingleFieldMode && (!eTask || eTask->m_fieldPicFlag)) ? 2 : 1;

for (int i = 0; i < numberOfCalls; ++i)
{
for (;;) {
Expand Down

0 comments on commit df84a2a

Please sign in to comment.