[Android] Recording: avoid null ref release

Geoffrey Métais git at videolan.org
Mon Apr 8 15:40:19 CEST 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Apr  8 09:33:18 2019 +0200| [7b0def9dbf55a1001db40fe879c3d87b6d7bd74b] | committer: Geoffrey Métais

Recording: avoid null ref release

> https://code.videolan.org/videolan/vlc-android/commit/7b0def9dbf55a1001db40fe879c3d87b6d7bd74b
---

 libvlc/jni/libvlcjni-mediaplayer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libvlc/jni/libvlcjni-mediaplayer.c b/libvlc/jni/libvlcjni-mediaplayer.c
index 4f7438c76..479c11437 100644
--- a/libvlc/jni/libvlcjni-mediaplayer.c
+++ b/libvlc/jni/libvlcjni-mediaplayer.c
@@ -1103,7 +1103,10 @@ Java_org_videolan_libvlc_MediaPlayer_nativeRecord(JNIEnv *env, jobject thiz,
 
     jboolean ret = record_func(p_obj->u.p_mp, psz_directory) == 0;
 
-    (*env)->ReleaseStringUTFChars(env, jdirectory, psz_directory);
+    if (psz_directory)
+    {
+        (*env)->ReleaseStringUTFChars(env, jdirectory, psz_directory);
+    }
 
     return ret;
 }



More information about the Android mailing list