summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2019-02-07 13:51:30 -0800
committer John Reck <jreck@google.com> 2019-02-07 13:51:30 -0800
commit003fda0197fd2159de2c0f9ab5c2069dbf89d5ba (patch)
treec8c582d3f7a8fe41f77a2e65e56c825e56004d01
parent598a0ebac1a369b76cf319f4d32cc10fdd88ef8d (diff)
Make sure to actually return after jniThrowException
It's illegal to keep using JNIEnv with a pending exception, and also a bit nonsensical to keep doing work if it's just going to throw when the native method returns Change-Id: I6ce66fc0d00f05a6fc33202c4aef266860472701 Fixes: 124064285 Test: android.graphics.cts.EGL15Test CTS test
-rw-r--r--core/jni/android_opengl_EGL15.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/core/jni/android_opengl_EGL15.cpp b/core/jni/android_opengl_EGL15.cpp
index b52f137da7d6..2abd95020f1c 100644
--- a/core/jni/android_opengl_EGL15.cpp
+++ b/core/jni/android_opengl_EGL15.cpp
@@ -194,6 +194,7 @@ fromEGLHandle(JNIEnv *_env, jmethodID mid, jobject obj) {
if (obj == NULL){
jniThrowException(_env, "java/lang/IllegalArgumentException",
"Object is set to null.");
+ return nullptr;
}
jlong handle = _env->CallLongMethod(obj, mid);
@@ -254,6 +255,7 @@ exit:
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
+ return nullptr;
}
return toEGLHandle(_env, eglsyncClass, eglsyncConstructor, _returnValue);
}
@@ -335,6 +337,7 @@ exit:
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
+ return false;
}
return (jboolean)_returnValue;
}
@@ -381,6 +384,7 @@ exit:
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
+ return nullptr;
}
return toEGLHandle(_env, egldisplayClass, egldisplayConstructor, _returnValue);
}
@@ -448,6 +452,7 @@ exit:
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
+ return nullptr;
}
return toEGLHandle(_env, eglsurfaceClass, eglsurfaceConstructor, _returnValue);
}
@@ -456,8 +461,11 @@ exit:
static jobject
android_eglCreatePlatformPixmapSurface
(JNIEnv *_env, jobject _this, jobject dpy, jobject config, jobject native_pixmap_buf, jlongArray attrib_list_ref, jint offset) {
- jniThrowException(_env, "java/lang/UnsupportedOperationException",
- "eglCreatePlatformPixmapSurface");
+ if ((true)) {
+ jniThrowException(_env, "java/lang/UnsupportedOperationException",
+ "eglCreatePlatformPixmapSurface");
+ return nullptr;
+ }
return toEGLHandle(_env, eglsurfaceClass, eglsurfaceConstructor, (EGLSurface) 0);
}
@@ -523,6 +531,7 @@ exit:
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
+ return nullptr;
}
return toEGLHandle(_env, eglimageClass, eglimageConstructor, _returnValue);
}