egl: Return the correct array size in _eglFlattenArray.

The function is used by _eglGetConfigs and _eglGetScreens.  The array
size should not be limited by the buffer size when the buffer is NULL.

This fixes fdo bug #29052.
This commit is contained in:
Chia-I Wu 2010-07-15 00:31:39 +08:00
parent 2f4ce25645
commit d7284b45e2

View file

@ -166,8 +166,11 @@ _eglFlattenArray(_EGLArray *array, void *buffer, EGLint elem_size, EGLint size,
if (!array)
return 0;
count = (size < array->Size) ? size : array->Size;
count = array->Size;
if (buffer) {
/* do not exceed buffer size */
if (count > size)
count = size;
for (i = 0; i < count; i++)
flatten(array->Elements[i],
(void *) ((char *) buffer + elem_size * i));