mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-21 01:38:23 +02:00
drisw_glx: handle XGetGeometry failure in get_drawable_geometry
When glXBindTexImageEXT is called on a drawable whose Window has been destroyed, XGetGeometry fails. The return value was not checked, leaving width/height uninitialized and causing a crash downstream. Check the return value and set w/h to 0 on failure. Reviewed-by: Marek Olšák <maraeo@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Assisted-by: DeepSeek V4 Flash Closes #327 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42192>
This commit is contained in:
parent
1e9fd4ca5b
commit
ced5ef2cfb
1 changed files with 1 additions and 0 deletions
|
|
@ -160,6 +160,7 @@ get_drawable_geometry(struct dri_drawable * draw,
|
|||
|
||||
drawable = pdraw->xDrawable;
|
||||
|
||||
uw = uh = 0;
|
||||
XGetGeometry(dpy, drawable, &root, x, y, &uw, &uh, &bw, &depth);
|
||||
*w = uw;
|
||||
*h = uh;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue