mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 11:33:03 +01:00
Guard against possible NULL dereference
This commit is contained in:
@@ -1250,8 +1250,9 @@ static void input_update_tooltip(rct_window *w, int widgetIndex, int x, int y)
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_CLASS, rct_windowclass) != w->classification ||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_NUMBER, rct_windownumber) != w->number ||
|
||||
if (((w != NULL) &&
|
||||
(RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_CLASS, rct_windowclass) != w->classification ||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_NUMBER, rct_windownumber) != w->number)) ||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WIDGET_INDEX, uint16) != widgetIndex
|
||||
) {
|
||||
window_tooltip_close();
|
||||
|
||||
Reference in New Issue
Block a user