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

Commit 2db3734e authored by Marco Nelissen's avatar Marco Nelissen Committed by Gerrit Code Review
Browse files

Merge "Fix benign overflows in ACodec"

parents 28dd6059 ad69e73b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1327,7 +1327,8 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() {
        }

        bool stale = false;
        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);

            if (info->mGraphicBuffer != NULL &&
@@ -1370,7 +1371,8 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() {

    // get oldest undequeued buffer
    BufferInfo *oldest = NULL;
    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);
        if (info->mStatus == BufferInfo::OWNED_BY_NATIVE_WINDOW &&