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

Commit 96b4e70f authored by Ray Essick's avatar Ray Essick Committed by android-build-merger
Browse files

Prevent OOB write in soft_avc encoder am: 463452a9 am: 97db64ba am:...

Prevent OOB write in soft_avc encoder am: 463452a9 am: 97db64ba am: b6bf4694 am: cd35c846 am: a43be7d4
am: 3c375611

Change-Id: I2af6025bbfea9927fb37e876b449f93732ddcd33
parents f0a54b35 3c375611
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -614,6 +614,7 @@ OMX_ERRORTYPE SoftAVC::initEncoder() {
    IV_STATUS_T status;
    WORD32 level;
    uint32_t displaySizeY;

    CHECK(!mStarted);

    OMX_ERRORTYPE errType = OMX_ErrorNone;
@@ -917,6 +918,9 @@ OMX_ERRORTYPE SoftAVC::releaseEncoder() {
        }
    }

    // clear other pointers into the space being free()d
    mCodecCtx = NULL;

    mStarted = false;

    return OMX_ErrorNone;
@@ -1509,6 +1513,14 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
    return;
}

void SoftAVC::onReset() {
    SoftVideoEncoderOMXComponent::onReset();

    if (releaseEncoder() != OMX_ErrorNone) {
        ALOGW("releaseEncoder failed");
    }
}

}  // namespace android

android::SoftOMXComponent *createSoftOMXComponent(
+2 −0
Original line number Diff line number Diff line
@@ -136,6 +136,8 @@ struct SoftAVC : public SoftVideoEncoderOMXComponent {
protected:
    virtual ~SoftAVC();

    virtual void onReset();

private:
    enum {
        kNumBuffers = 2,