diff options
author | Sven Gothel <[email protected]> | 2014-03-11 01:44:31 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-03-11 01:44:31 +0100 |
commit | fdea8596b2ccc1221a980e4c9fd10de85d885a3c (patch) | |
tree | c04dd20cd2c6c8855b3ae12f187f973751b9f9ed | |
parent | fdd60adb1d421f2018b47ee17e9079c94b54910f (diff) |
Bug 961: Fix commit fdd60adb1d421f2018b47ee17e9079c94b54910f (memmove byte-count)
memmove's byte-count was just giving the element-count, missing the element-size multiplier to actually pass byte-count
-rw-r--r-- | make/config/jogl/glx-CustomCCode.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/make/config/jogl/glx-CustomCCode.c b/make/config/jogl/glx-CustomCCode.c index 3f5cf1121..b077c65ac 100644 --- a/make/config/jogl/glx-CustomCCode.c +++ b/make/config/jogl/glx-CustomCCode.c @@ -141,13 +141,16 @@ Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseFBConfig(JNIEnv *env, jclass _ count = _nitems_ptr[0]; if (NULL == _res) return NULL; - /** Bug 961: Validate returned 'GLXFBConfig *', i.e. remove NULL pointer. */ + /** + * Bug 961: Validate returned 'GLXFBConfig *', i.e. remove NULL pointer. + * Note: sizeof(GLXFBConfig) == sizeof(void*), a.k.a a pointer + */ // fprintf(stderr, "glXChooseFBConfig.0: Count %d\n", count); i=0; while( i < count ) { if( NULL == _res[i] ) { if( 0 < count-i-1 ) { - memmove(_res+i, _res+i+1, count-i-1); + memmove(_res+i, _res+i+1, (count-i-1)*sizeof(GLXFBConfig)); } count--; } else { @@ -188,12 +191,15 @@ Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXGetFBConfigs(JNIEnv *env, jclass _un count = _nelements_ptr[0]; if (NULL == _res) return NULL; - /** Bug 961: Validate returned 'GLXFBConfig *', i.e. remove NULL pointer. */ + /** + * Bug 961: Validate returned 'GLXFBConfig *', i.e. remove NULL pointer. + * Note: sizeof(GLXFBConfig) == sizeof(void*), a.k.a a pointer + */ i=0; while( i < count ) { if( NULL == _res[i] ) { if( 0 < count-i-1 ) { - memmove(_res+i, _res+i+1, count-i-1); + memmove(_res+i, _res+i+1, (count-i-1)*sizeof(GLXFBConfig)); } count--; } else { |