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

Commit c5baeace 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

Change-Id: I793c94207be6d2866ad1458e070805fccc971435
parents 3145a63d 2f5f0ace
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);