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

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

Merge "fix crash when makeHTTPConnection fails with null pointer" into lmp-dev

parents d7f77cd7 217bde88
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -199,7 +199,18 @@ sp<DataSource> DataSource::CreateFromURI(
    } else if (!strncasecmp("http://", uri, 7)
            || !strncasecmp("https://", uri, 8)
            || isWidevine) {
        sp<HTTPBase> httpSource = new MediaHTTP(httpService->makeHTTPConnection());
        if (httpService == NULL) {
            ALOGE("Invalid http service!");
            return NULL;
        }

        sp<IMediaHTTPConnection> conn = httpService->makeHTTPConnection();
        if (conn == NULL) {
            ALOGE("Failed to make http connection from http service!");
            return NULL;
        }

        sp<HTTPBase> httpSource = new MediaHTTP(conn);

        String8 tmp;
        if (isWidevine) {