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

Commit ad69e73b authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Fix benign overflows in ACodec

Change-Id: Ia699f8a9f5367a9b38aaa6bbbdb0097c3e2ab551
parent e4a595cb
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 &&