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

Commit 3c69e8d5 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
am: 1a9b5e0f

* commit '1a9b5e0f':
  Also fix out of bounds access for normal read
parents 52598348 1a9b5e0f
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -4228,7 +4228,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;