summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/native
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-12-18 04:24:22 +0100
committerSven Gothel <[email protected]>2011-12-18 04:24:22 +0100
commita257c96564e3afa9d030e348392f464cacd55ea7 (patch)
tree3f93667a91eacd6d66f39841c3d6390ea01860bc /src/nativewindow/native
parent5ae7fe56614cb8abaf389f945cec2ba1db262479 (diff)
JAWT_DrawingSurface.c: Fail fast in case of NULL platformInfo or sizeof(platformInfo)==0
Diffstat (limited to 'src/nativewindow/native')
-rw-r--r--src/nativewindow/native/JAWT_DrawingSurfaceInfo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c b/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c
index 470f03a49..2a6651007 100644
--- a/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c
+++ b/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c
@@ -59,6 +59,13 @@ Java_jogamp_nativewindow_jawt_JAWT_1DrawingSurfaceInfo_platformInfo0(JNIEnv* env
return NULL;
}
if (dsi->platformInfo == NULL) {
+ (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/RuntimeException"),
+ "platformInfo pointer is NULL");
+ return NULL;
+ }
+ if(0==PLATFORM_DSI_SIZE) {
+ (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/RuntimeException"),
+ "platformInfo size is 0");
return NULL;
}
return (*env)->NewDirectByteBuffer(env, dsi->platformInfo, PLATFORM_DSI_SIZE);