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

Commit 6b1e695c authored by Wonsik Kim's avatar Wonsik Kim
Browse files

TV: check surface validity before use

Bug: 23118610
Change-Id: I4eede52de3c66e3f1e4fb442724581e01dbd99c3
parent 342b89e2
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -414,12 +414,9 @@ int JTvInputHal::removeStream(int deviceId, int streamId) {
        return NO_ERROR;
    }
    if (Surface::isValid(connection.mSurface)) {
        connection.mSurface.clear();
    }
    if (connection.mSurface != NULL) {
        connection.mSurface->setSidebandStream(NULL);
        connection.mSurface.clear();
    }
    connection.mSurface.clear();
    if (connection.mThread != NULL) {
        connection.mThread->shutdown();
        connection.mThread.clear();
@@ -616,6 +613,9 @@ static int nativeAddOrUpdateStream(JNIEnv* env, jclass clazz,
        return BAD_VALUE;
    }
    sp<Surface> surface(android_view_Surface_getSurface(env, jsurface));
    if (!Surface::isValid(surface)) {
        return BAD_VALUE;
    }
    return tvInputHal->addOrUpdateStream(deviceId, streamId, surface);
}