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

Commit 1a9b5e0f authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Also fix out of bounds access for normal read" into klp-dev am:...

Merge "Also fix out of bounds access for normal read" into klp-dev am: dc17049b am: fc4f7396 am: 2bb66e25 am: 5371723c am: 9f31a893
am: 037bdfc7

* commit '037bdfc7':
  Also fix out of bounds access for normal read
parents 6bac803b 037bdfc7
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -3990,7 +3990,15 @@ status_t MPEG4Source::read(
                    continue;
                }

                CHECK(dstOffset + 4 <= mBuffer->size());
                if (dstOffset > SIZE_MAX - 4 ||
                        dstOffset + 4 > SIZE_MAX - nalLength ||
                        dstOffset + 4 + nalLength > mBuffer->size()) {
                    ALOGE("b/27208621 : %zu %zu", dstOffset, mBuffer->size());
                    android_errorWriteLog(0x534e4554, "27208621");
                    mBuffer->release();
                    mBuffer = NULL;
                    return ERROR_MALFORMED;
                }

                dstData[dstOffset++] = 0;
                dstData[dstOffset++] = 0;