summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/jni/android_media_MediaPlayer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp
index 04ba348..ad536f2 100644
--- a/media/jni/android_media_MediaPlayer.cpp
+++ b/media/jni/android_media_MediaPlayer.cpp
@@ -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",