aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorathomas <[email protected]>2003-11-18 03:14:17 +0000
committerathomas <[email protected]>2003-11-18 03:14:17 +0000
commit75210d2be19a7e84859cf07cd69e67cf77893b5e (patch)
tree23f2051ebae28511e726304df03e607f3ad21826 /src
parent98073d1171b6cf24eb5e2b5e0b922e127a804be0 (diff)
Proper handling of null in alcOpenDevice
git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/git-svn/../svn-server-sync/joal/trunk@58 03bf7f67-59de-4072-a415-9a990d468a3f
Diffstat (limited to 'src')
-rw-r--r--src/native/alcbind.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/native/alcbind.c b/src/native/alcbind.c
index 5933810..13fdef2 100644
--- a/src/native/alcbind.c
+++ b/src/native/alcbind.c
@@ -44,8 +44,10 @@ JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_alcGetErrorNative
JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_openDeviceNative
(JNIEnv *env, jobject obj, jstring deviceName) {
jint result;
- ALubyte *str;
- str = (ALubyte*)(*env)->GetStringUTFChars(env,deviceName,NULL);
+ ALubyte *str = NULL;
+ if(deviceName == NULL) {
+ str = (ALubyte*)(*env)->GetStringUTFChars(env,deviceName,NULL);
+ }
ALCdevice *device;
device = alcOpenDevice(str);
(*env)->ReleaseStringUTFChars(env,deviceName,str);