[libbluray-devel] bdj_make_array(): check FindClass() result

hpi1 git at videolan.org
Sun Mar 26 14:21:19 CEST 2017


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Mar 17 14:20:31 2017 +0200| [afabde7662ce9f24bde89d38cfda677c63daa958] | committer: hpi1

bdj_make_array(): check FindClass() result

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=afabde7662ce9f24bde89d38cfda677c63daa958
---

 src/libbluray/bdj/native/util.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/libbluray/bdj/native/util.c b/src/libbluray/bdj/native/util.c
index c034554..12fab99 100644
--- a/src/libbluray/bdj/native/util.c
+++ b/src/libbluray/bdj/native/util.c
@@ -49,5 +49,9 @@ jobject bdj_make_object(JNIEnv* env, const char* name, const char* sig, ...)
 jobjectArray bdj_make_array(JNIEnv* env, const char* name, int count)
 {
     jclass arr_class = (*env)->FindClass(env, name);
+    if (!arr_class) {
+        BD_DEBUG(DBG_BDJ | DBG_CRIT, "Class %s not found\n", name);
+        return NULL;
+    }
     return (*env)->NewObjectArray(env, count, arr_class, NULL);
 }



More information about the libbluray-devel mailing list