mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 18:10:17 +01:00
glx: Reject glXSwapIntervalMESA greater than INT_MAX
It wouldn't work in any case, as the internal API only stores a signed int, and GLX_EXT_swap_control_tear will overload the meaning of negative values so we should avoid ambiguity. If your application needs a swap interval in excess of ~414.25 days, I'm very sorry. Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6671>
This commit is contained in:
parent
e648442ceb
commit
b8239abdf8
1 changed files with 4 additions and 1 deletions
|
|
@ -51,7 +51,7 @@
|
|||
#endif /* GLX_USE_WINDOWSGL */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
#include <X11/Xlib-xcb.h>
|
||||
#include <xcb/xcb.h>
|
||||
#include <xcb/glx.h>
|
||||
|
|
@ -1796,6 +1796,9 @@ glXSwapIntervalMESA(unsigned int interval)
|
|||
#ifdef GLX_DIRECT_RENDERING
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
|
||||
if (interval > INT_MAX)
|
||||
return GLX_BAD_VALUE;
|
||||
|
||||
if (gc != &dummyContext && gc->isDirect) {
|
||||
struct glx_screen *psc;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue