Guard against negative screen indices in Workspace::xineramaIndexToOutput()

This commit is contained in:
Vlad Zahorodnii 2024-04-02 20:10:34 +03:00
parent 883acb1f58
commit baaa1db5d1

View file

@ -2582,7 +2582,7 @@ Output *Workspace::xineramaIndexToOutput(int index) const
}
const int infoCount = xcb_xinerama_query_screens_screen_info_length(screens.get());
if (index >= infoCount) {
if (index < 0 || index >= infoCount) {
return nullptr;
}