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

Commit 097922b9 authored by James Dong's avatar James Dong
Browse files

Throw an exception instead of crash when a surface does not have a binding surface texture

o related-to-bug: 7270329

Change-Id: I498d72187968e89d9498d01b10719569e12be2af
parent 31fed737
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -274,6 +274,11 @@ setVideoSurface(JNIEnv *env, jobject thiz, jobject jsurface, jboolean mediaPlaye
        sp<Surface> surface(android_view_Surface_getSurface(env, jsurface));
        if (surface != NULL) {
            new_st = surface->getSurfaceTexture();
            if (new_st == NULL) {
                jniThrowException(env, "java/lang/IllegalArgumentException",
                    "The surface does not have a binding SurfaceTexture!");
                return;
            }
            new_st->incStrong(thiz);
        } else {
            jniThrowException(env, "java/lang/IllegalArgumentException",