Module: wine Branch: oldstable Commit: ff738dec335ec0bf0b8159b6b5c96b85ee4a373c URL: https://gitlab.winehq.org/wine/wine/-/commit/ff738dec335ec0bf0b8159b6b5c96b8...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Tue May 17 16:45:58 2022 +0800
winex11.drv: Don't compare error event serial if it's zero.
Sometimes error event serial is zero. For example, NVIDIA driver may send X_GLXCopyContext errors with the event serial set to zero. When it's zero, previously the error handler passes the error to the default error handler and cause application crashes.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com (cherry picked from commit d328af75fee0f10dab67ab64fee78e2e2da7a447) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/winex11.drv/x11drv_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 32beb84a009..c98151149d8 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -292,7 +292,7 @@ int X11DRV_check_error(void) static int error_handler( Display *display, XErrorEvent *error_evt ) { if (err_callback && display == err_callback_display && - (long)(error_evt->serial - err_serial) >= 0) + (!error_evt->serial || error_evt->serial >= err_serial)) { if ((err_callback_result = err_callback( display, error_evt, err_callback_arg ))) {