mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
glx/dri3: handle NULL pointers in loader-to-DRI3 drawable conversion
With a subsequent patch, we might see NULL loaderPrivates, e.g. when
a DRIdrawable is flushed whose corresponding GLXDRIdrawable was destroyed.
This resulted in a crash, since the loader vs. DRI3 drawable structures
have a non-zero offset.
Fixes glx-visuals-{depth,stencil} -pixmap
Cc: 17.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
02264bc6f9
commit
40c304fc06
1 changed files with 2 additions and 0 deletions
|
|
@ -81,6 +81,8 @@
|
|||
static struct dri3_drawable *
|
||||
loader_drawable_to_dri3_drawable(struct loader_dri3_drawable *draw) {
|
||||
size_t offset = offsetof(struct dri3_drawable, loader_drawable);
|
||||
if (!draw)
|
||||
return NULL;
|
||||
return (struct dri3_drawable *)(((void*) draw) - offset);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue