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

Commit 117c6f7d authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Avoid reading at negative offsets"

parents 7e101988 1b41d449
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@ ssize_t PlayerServiceFileSource::readAt(off64_t offset, void *data, size_t size)
    Mutex::Autolock autoLock(mLock);

    if (mLength >= 0) {
        if (offset < 0) {
            return UNKNOWN_ERROR;
        }
        if (offset >= mLength) {
            return 0;  // read beyond EOF.
        }