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

Commit d975e98a authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "MediaHTTP: add more null ptr and init checks" into mnc-dev

parents 70c75d8c 37d8b27e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ struct BpMediaHTTPService : public BpInterface<IMediaHTTPService> {
        status_t err = reply.readInt32();

        if (err != OK) {
            ALOGE("Unable to make HTTP connection (err = %d)", err);
            return NULL;
        }

+5 −2
Original line number Diff line number Diff line
@@ -30,12 +30,11 @@
namespace android {

MediaHTTP::MediaHTTP(const sp<IMediaHTTPConnection> &conn)
    : mInitCheck(NO_INIT),
    : mInitCheck((conn != NULL) ? OK : NO_INIT),
      mHTTPConnection(conn),
      mCachedSizeValid(false),
      mCachedSize(0ll),
      mDrmManagerClient(NULL) {
    mInitCheck = OK;
}

MediaHTTP::~MediaHTTP() {
@@ -171,6 +170,10 @@ void MediaHTTP::getDrmInfo(
}

String8 MediaHTTP::getUri() {
    if (mInitCheck != OK) {
        return String8::empty();
    }

    String8 uri;
    if (OK == mHTTPConnection->getUri(&uri)) {
        return uri;