Lines 91-97
Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseFBConfig(JNIEnv *env, jclass _
Link Here
|
91 |
* Bug 961: Validate returned 'GLXFBConfig *', i.e. remove NULL pointer. |
91 |
* Bug 961: Validate returned 'GLXFBConfig *', i.e. remove NULL pointer. |
92 |
* Note: sizeof(GLXFBConfig) == sizeof(void*), a.k.a a pointer |
92 |
* Note: sizeof(GLXFBConfig) == sizeof(void*), a.k.a a pointer |
93 |
*/ |
93 |
*/ |
94 |
// fprintf(stderr, "glXChooseFBConfig.0: Count %d\n", count); |
94 |
fprintf(stderr, "before glXChooseFBConfig.0: Count %d\n", count); |
95 |
i=0; |
95 |
i=0; |
96 |
while( i < count ) { |
96 |
while( i < count ) { |
97 |
if( NULL == _res[i] ) { |
97 |
if( NULL == _res[i] ) { |
Lines 103-110
Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseFBConfig(JNIEnv *env, jclass _
Link Here
|
103 |
i++; |
103 |
i++; |
104 |
} |
104 |
} |
105 |
} |
105 |
} |
106 |
// fprintf(stderr, "glXChooseFBConfig.X: Count %d\n", count); |
106 |
fprintf(stderr, "after glXChooseFBConfig.X: Count %d\n", count); |
107 |
|
107 |
fprintf(stderr, "copy bytes %d\n", count * sizeof(GLXFBConfig)); |
108 |
jbyteCopy = JVMUtil_NewDirectByteBufferCopy(env, _res, count * sizeof(GLXFBConfig)); |
108 |
jbyteCopy = JVMUtil_NewDirectByteBufferCopy(env, _res, count * sizeof(GLXFBConfig)); |
109 |
XFree(_res); |
109 |
XFree(_res); |
110 |
|
110 |
|
Lines 132-138
Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXGetFBConfigs(JNIEnv *env, jclass _un
Link Here
|
132 |
_res = (* ptr_glXGetFBConfigs) ((Display *) (intptr_t) dpy, (int) screen, (int *) _nelements_ptr); |
132 |
_res = (* ptr_glXGetFBConfigs) ((Display *) (intptr_t) dpy, (int) screen, (int *) _nelements_ptr); |
133 |
count = _nelements_ptr[0]; |
133 |
count = _nelements_ptr[0]; |
134 |
if (NULL == _res) return NULL; |
134 |
if (NULL == _res) return NULL; |
135 |
|
135 |
fprintf(stderr, "before glXGetFBConfigs.0: Count %d\n", count); |
136 |
/** |
136 |
/** |
137 |
* Bug 961: Validate returned 'GLXFBConfig *', i.e. remove NULL pointer. |
137 |
* Bug 961: Validate returned 'GLXFBConfig *', i.e. remove NULL pointer. |
138 |
* Note: sizeof(GLXFBConfig) == sizeof(void*), a.k.a a pointer |
138 |
* Note: sizeof(GLXFBConfig) == sizeof(void*), a.k.a a pointer |
Lines 148-154
Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXGetFBConfigs(JNIEnv *env, jclass _un
Link Here
|
148 |
i++; |
148 |
i++; |
149 |
} |
149 |
} |
150 |
} |
150 |
} |
151 |
|
151 |
fprintf(stderr, "after glXGetFBConfigs.X: Count %d\n", count); |
152 |
jbyteCopy = JVMUtil_NewDirectByteBufferCopy(env, _res, count * sizeof(GLXFBConfig)); |
152 |
jbyteCopy = JVMUtil_NewDirectByteBufferCopy(env, _res, count * sizeof(GLXFBConfig)); |
153 |
XFree(_res); |
153 |
XFree(_res); |
154 |
|
154 |
|
Lines 175-181
Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseVisual(JNIEnv *env, jclass _un
Link Here
|
175 |
assert(ptr_glXChooseVisual != NULL); |
175 |
assert(ptr_glXChooseVisual != NULL); |
176 |
_res = (* ptr_glXChooseVisual) ((Display *) (intptr_t) dpy, (int) screen, (int *) _attribList_ptr); |
176 |
_res = (* ptr_glXChooseVisual) ((Display *) (intptr_t) dpy, (int) screen, (int *) _attribList_ptr); |
177 |
if (NULL == _res) return NULL; |
177 |
if (NULL == _res) return NULL; |
178 |
|
178 |
|
179 |
jbyteCopy = JVMUtil_NewDirectByteBufferCopy(env, _res, sizeof(XVisualInfo)); |
179 |
jbyteCopy = JVMUtil_NewDirectByteBufferCopy(env, _res, sizeof(XVisualInfo)); |
180 |
XFree(_res); |
180 |
XFree(_res); |
181 |
|
181 |
|