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

Commit 7f61a67c authored by Henry Fang's avatar Henry Fang
Browse files

Fixed a invalid fd issue

LinearBlock close the fd why it's recycled, so we need dup the fd to create a LinearBlock.

bug: 159753135
Test: Manual
Change-Id: Ic2b4e3c535e60983b2a4fc5f5ce6e809731fd581
parent e948137a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ jobject MediaEvent::getLinearBlock() {
    if (mLinearBlockObj != NULL) {
        return mLinearBlockObj;
    }
    mIonHandle = new C2HandleIon(mAvHandle->data[0], mDataLength);
    mIonHandle = new C2HandleIon(dup(mAvHandle->data[0]), mDataLength);
    std::shared_ptr<C2LinearBlock> block = _C2BlockFactory::CreateLinearBlock(mIonHandle);

    JNIEnv *env = AndroidRuntime::getJNIEnv();