Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c41a9f1 authored by Harish Mahendrakar's avatar Harish Mahendrakar
Browse files

benchmark: Fix NPD in Encode::deInitCodec()

In some cases where initCodec() fails, deInitCodec() should not
call AMediaCodec_stop() as mCodec is NULL.

Bug: 147158050
Test: poc in bug

Change-Id: I5dc1bf1fed8fe086e16a9f07e1289980333b8a12
parent e5f01a7d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ void Encoder::deInitCodec() {
        AMediaFormat_delete(mFormat);
        mFormat = nullptr;
    }
    if (!mCodec) return;
    AMediaCodec_stop(mCodec);
    AMediaCodec_delete(mCodec);
    int64_t eTime = mStats->getCurTime();