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

Commit f6f621cf authored by Nick Kralevich's avatar Nick Kralevich Committed by Android Git Automerger
Browse files

am 938e2b34: don\'t trigger an integer underflow when decrementing.

* commit '938e2b34':
  don't trigger an integer underflow when decrementing.
parents 0c5c9743 938e2b34
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1396,7 +1396,8 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() {

status_t ACodec::freeBuffersOnPort(OMX_U32 portIndex) {
    status_t err = OK;
    for (size_t i = mBuffers[portIndex].size(); i-- > 0;) {
    for (size_t i = mBuffers[portIndex].size(); i > 0;) {
        i--;
        status_t err2 = freeBuffer(portIndex, i);
        if (err == OK) {
            err = err2;
@@ -1410,7 +1411,8 @@ status_t ACodec::freeBuffersOnPort(OMX_U32 portIndex) {

status_t ACodec::freeOutputBuffersNotOwnedByComponent() {
    status_t err = OK;
    for (size_t i = mBuffers[kPortIndexOutput].size(); i-- > 0;) {
    for (size_t i = mBuffers[kPortIndexOutput].size(); i > 0;) {
        i--;
        BufferInfo *info =
            &mBuffers[kPortIndexOutput].editItemAt(i);

+2 −1
Original line number Diff line number Diff line
@@ -220,7 +220,8 @@ void MediaCodecList::parseTopLevelXMLFile(const char *codecs_xml, bool ignore_er
        }
    }

    for (size_t i = mCodecInfos.size(); i-- > 0;) {
    for (size_t i = mCodecInfos.size(); i > 0;) {
        i--;
        const MediaCodecInfo &info = *mCodecInfos.itemAt(i).get();
        if (info.mCaps.size() == 0) {
            // No types supported by this component???
+2 −1
Original line number Diff line number Diff line
@@ -109,7 +109,8 @@ void AHierarchicalStateMachine::changeState(const sp<AState> &state) {
        A.editItemAt(i)->stateExited();
    }

    for (size_t i = B.size(); i-- > 0;) {
    for (size_t i = B.size(); i > 0;) {
        i--;
        B.editItemAt(i)->stateEntered();
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -79,7 +79,8 @@ void ALooperRoster::unregisterStaleHandlers() {
    {
        Mutex::Autolock autoLock(mLock);

        for (size_t i = mHandlers.size(); i-- > 0;) {
        for (size_t i = mHandlers.size(); i > 0;) {
            i--;
            const HandlerInfo &info = mHandlers.valueAt(i);

            sp<ALooper> looper = info.mLooper.promote();