mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-11-27 16:24:29 +00:00
Update AppModel, ComputerModel, and StreamUtil asserts to cover negative indices
This commit is contained in:
1 parent
2d600c4e6b
commit
4e8fc3aead
3 files changed
+13
-13
No files matched your search
@@ -266,7 +266,7 @@ bool StreamUtils::getNativeDesktopMode(int displayIndex, SDL_DisplayMode* mode,
|
||||
CGDirectDisplayID displayIds[MAX_DISPLAYS];
|
||||
uint32_t displayCount = 0;
|
||||
CGGetActiveDisplayList(MAX_DISPLAYS, displayIds, &displayCount);
|
||||
if (displayIndex >= (int)displayCount) {
|
||||
if (displayIndex < 0 || displayIndex >= (int)displayCount) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ bool StreamUtils::getNativeDesktopMode(int displayIndex, SDL_DisplayMode* mode,
|
||||
#else
|
||||
SDL_assert(SDL_WasInit(SDL_INIT_VIDEO));
|
||||
|
||||
if (displayIndex >= SDL_GetNumVideoDisplays()) {
|
||||
if (displayIndex < 0 || displayIndex >= SDL_GetNumVideoDisplays()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user