From d1a03d19398960d6e34232f29a30f1d569fba2a7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 6 Nov 2010 06:26:56 +0100 Subject: Fix buffer size: 64bit GLBufferSizeTracker, hash over addr+size, save fail-fast hash cache, .. Relates to GlueGen 6b6b9b3b81cdc85b7260664ebec547756a6be5d7, branch sgothel_wip_fixes01. Memory object size is ptrdiff_t, hence long (64bit). The hash value must include size as well, otherwise boundaries cannot be verified. (security) Double check hash collisions while adding a new MemoryObject. --- make/config/jogl/gl-impl-CustomCCode-gles2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'make/config/jogl/gl-impl-CustomCCode-gles2.c') diff --git a/make/config/jogl/gl-impl-CustomCCode-gles2.c b/make/config/jogl/gl-impl-CustomCCode-gles2.c index f99822d65..86fc47b4b 100644 --- a/make/config/jogl/gl-impl-CustomCCode-gles2.c +++ b/make/config/jogl/gl-impl-CustomCCode-gles2.c @@ -16,10 +16,10 @@ Java_com_jogamp_opengl_impl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, job /* Java->C glue code: * Java package: com.jogamp.opengl.impl.es2.GLES2Impl - * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); - * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); + * Java method: ByteBuffer newDirectByteBuffer(long addr, long capacity); + * C function: jobject newDirectByteBuffer(jlong addr, jlong capacity); */ JNIEXPORT jobject JNICALL -Java_com_jogamp_opengl_impl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { +Java_com_jogamp_opengl_impl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jlong capacity) { return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); } -- cgit v1.2.3