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

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

Don't read more than the buffer size. am: 2f5f0ace

am: c5baeace

Change-Id: Ifb21761dfd26885a396bd74fb2c4eef7c4c4f1f2
parents 37e5756b c5baeace
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -461,7 +461,7 @@ media_status_t WAVSource::read(
    }

    // maxBytesToRead may be reduced so that in-place data conversion will fit in buffer size.
    const size_t bufferSize = buffer->size();
    const size_t bufferSize = std::min(buffer->size(), kMaxFrameSize);
    size_t maxBytesToRead;
    if (mOutputFloat) { // destination is float at 4 bytes per sample, source may be less.
        maxBytesToRead = (mBitsPerSample / 8) * (bufferSize / 4);