mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
mesa: check for enabled extensions for *UID enums
Applications might use them without checking if the extension is supported
and would run into a NULL pointer deref calling the callbacks.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30455>
(cherry picked from commit 740cae64a1)
This commit is contained in:
parent
c86eba672a
commit
05f1c0b9ea
2 changed files with 9 additions and 1 deletions
|
|
@ -5634,7 +5634,7 @@
|
|||
"description": "mesa: check for enabled extensions for *UID enums",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -2908,20 +2908,28 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
|
|||
|
||||
/* GL_EXT_external_objects */
|
||||
case GL_NUM_DEVICE_UUIDS_EXT:
|
||||
if (!ctx->Extensions.EXT_memory_object && !ctx->Extensions.EXT_semaphore)
|
||||
goto invalid_enum;
|
||||
v->value_int = 1;
|
||||
return TYPE_INT;
|
||||
case GL_DRIVER_UUID_EXT:
|
||||
if (!ctx->Extensions.EXT_memory_object && !ctx->Extensions.EXT_semaphore)
|
||||
goto invalid_enum;
|
||||
if (index >= 1)
|
||||
goto invalid_value;
|
||||
_mesa_get_driver_uuid(ctx, v->value_int_4);
|
||||
return TYPE_INT_4;
|
||||
case GL_DEVICE_UUID_EXT:
|
||||
if (!ctx->Extensions.EXT_memory_object && !ctx->Extensions.EXT_semaphore)
|
||||
goto invalid_enum;
|
||||
if (index >= 1)
|
||||
goto invalid_value;
|
||||
_mesa_get_device_uuid(ctx, v->value_int_4);
|
||||
return TYPE_INT_4;
|
||||
/* GL_EXT_memory_object_win32 */
|
||||
case GL_DEVICE_LUID_EXT:
|
||||
if (!ctx->Extensions.EXT_memory_object_win32 && !ctx->Extensions.EXT_semaphore_win32)
|
||||
goto invalid_enum;
|
||||
if (index >= 1)
|
||||
goto invalid_value;
|
||||
_mesa_get_device_luid(ctx, v->value_int_2);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue