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

Commit 5d44fff7 authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

DO NOT MERGE Add VPX output buffer size check

am: 1595f8ac

* commit '1595f8ac':
  DO NOT MERGE Add VPX output buffer size check
parents 50af72bc 1595f8ac
Loading
Loading
Loading
Loading
+29 −24
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ void SoftVPX::onQueueFilled(OMX_U32 portIndex) {
            outHeader->nFlags = EOSseen ? OMX_BUFFERFLAG_EOS : 0;
            outHeader->nTimeStamp = inHeader->nTimeStamp;

            if (outHeader->nAllocLen >= outHeader->nFilledLen) {
                const uint8_t *srcLine = (const uint8_t *)img->planes[VPX_PLANE_Y];
                uint8_t *dst = outHeader->pBuffer;
                for (size_t i = 0; i < img->d_h; ++i) {
@@ -179,7 +180,11 @@ void SoftVPX::onQueueFilled(OMX_U32 portIndex) {
                    srcLine += img->stride[VPX_PLANE_V];
                    dst += img->d_w / 2;
                }

            } else {
                ALOGE("b/27597103, buffer too small");
                android_errorWriteLog(0x534e4554, "27597103");
                outHeader->nFilledLen = 0;
            }
            outInfo->mOwnedByUs = false;
            outQueue.erase(outQueue.begin());
            outInfo = NULL;
+6 −1
Original line number Diff line number Diff line
@@ -170,7 +170,12 @@ void OMX::binderDied(const wp<IBinder> &the_late_who) {
        Mutex::Autolock autoLock(mLock);

        ssize_t index = mLiveNodes.indexOfKey(the_late_who);
        CHECK(index >= 0);

        if (index < 0) {
            ALOGE("b/27597103, nonexistent observer on binderDied");
            android_errorWriteLog(0x534e4554, "27597103");
            return;
        }

        instance = mLiveNodes.editValueAt(index);
        mLiveNodes.removeItemsAt(index);