mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 07:00:12 +01:00
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:
parent
2f4ce25645
commit
d7284b45e2
1 changed files with 4 additions and 1 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue