From: Zhiyi Zhang <zzhang(a)codeweavers.com> 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(a)codeweavers.com> --- 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 4fe450237d3..44d4763b316 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -304,7 +304,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 ))) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/416