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

Commit 98895b31 authored by Alex Klyubin's avatar Alex Klyubin Committed by Android Git Automerger
Browse files

am 808fa88b: Merge "readAt can return negative values (error codes)." into mnc-dev

* commit '808fa88b':
  readAt can return negative values (error codes).
parents 96287c43 808fa88b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -107,7 +107,14 @@ struct BpMediaHTTPConnection : public BpInterface<IMediaHTTPConnection> {
            return UNKNOWN_ERROR;
        }

        size_t len = reply.readInt32();
        int32_t lenOrErrorCode = reply.readInt32();

        // Negative values are error codes
        if (lenOrErrorCode < 0) {
            return lenOrErrorCode;
        }

        size_t len = lenOrErrorCode;

        if (len > size) {
            ALOGE("requested %zu, got %zu", size, len);