[libbluray-devel] "Fix" converting void* to function pointer

hpi1 git at videolan.org
Fri May 12 13:51:33 CEST 2017


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri May 12 14:05:27 2017 +0300| [da2791759817eee17fea7276f491896a262b89cb] | committer: hpi1

"Fix" converting void* to function pointer

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

 src/libbluray/bdj/bdj.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index 67767bd5..ea844e92 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -701,7 +701,9 @@ static int _create_jvm(void *jvm_lib, const char *java_home, const char *jar_fil
 {
     (void)java_home;  /* used only with J2ME */
 
-    fptr_JNI_CreateJavaVM JNI_CreateJavaVM_fp = (fptr_JNI_CreateJavaVM)(intptr_t)dl_dlsym(jvm_lib, "JNI_CreateJavaVM");
+    fptr_JNI_CreateJavaVM JNI_CreateJavaVM_fp;
+
+    *(void **)&JNI_CreateJavaVM_fp = dl_dlsym(jvm_lib, "JNI_CreateJavaVM");
     if (JNI_CreateJavaVM_fp == NULL) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "Couldn't find symbol JNI_CreateJavaVM.\n");
         return 0;



More information about the libbluray-devel mailing list