summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-10-04 09:16:40 -0700
committerJames Dong <jdong@google.com>2012-10-04 09:16:40 -0700
commit097922b9c1e0821beb107024bcd0dc14144c0920 (patch)
tree7bd698fa97f3f0bff9c3954ba56a791ba886fede /media
parent31fed73701041cd5455942abe2dacfc7639c5370 (diff)
downloadframeworks_base-097922b9c1e0821beb107024bcd0dc14144c0920.zip
frameworks_base-097922b9c1e0821beb107024bcd0dc14144c0920.tar.gz
frameworks_base-097922b9c1e0821beb107024bcd0dc14144c0920.tar.bz2
Throw an exception instead of crash when a surface does not have a binding surface texture
o related-to-bug: 7270329 Change-Id: I498d72187968e89d9498d01b10719569e12be2af
Diffstat (limited to 'media')
-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",