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

Commit 47dcb48b authored by Sungtak Lee's avatar Sungtak Lee
Browse files

CCodec: Do not crash when there is no OMX service

Before dereferncing OMX service, check whether the service is retrieved
and valid.

Bug: 205761766
Change-Id: Iff3aed110949469a27e0ffdb530eb9344a5d97ad
parent 12c71eef
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1526,6 +1526,9 @@ sp<PersistentSurface> CCodec::CreateOmxInputSurface() {
    using namespace android::hardware::graphics::bufferqueue::V1_0::utils;
    typedef android::hardware::media::omx::V1_0::Status OmxStatus;
    android::sp<IOmx> omx = IOmx::getService();
    if (omx == nullptr) {
        return nullptr;
    }
    typedef android::hardware::graphics::bufferqueue::V1_0::
            IGraphicBufferProducer HGraphicBufferProducer;
    typedef android::hardware::media::omx::V1_0::