Module: Mesa Branch: master Commit: b8236bcb7444157c0acbf9b775856be7075e97e1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b8236bcb7444157c0acbf9b775856be7075e97e1
Author: Adam Jackson <[email protected]> Date: Mon Apr 12 11:33:17 2021 -0400 glx: Be more robust against null fbconfigs These can happen along the internal paths for no-config contexts, and we shouldn't crash. Acked-By: Mike Blumenkrantz <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9992> --- src/glx/glx_pbuffer.c | 3 +++ src/glx/glxcmds.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index 73835b5cced..74b9b55c718 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -455,6 +455,9 @@ CreateDrawable(Display *dpy, struct glx_config *config, CARD8 opcode; GLXDrawable xid; + if (!config) + return None; + i = 0; if (attrib_list) { while (attrib_list[i * 2] != None) diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index fb4249ebab2..7a2a31ad26b 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -1732,6 +1732,9 @@ glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig fbconfig) struct glx_config *config = (struct glx_config *) fbconfig; int count; + if (!config) + return NULL; + /* ** Get a list of all visuals, return if list is empty */ _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
