Skip to content

Commit 2770b35

Browse files
authored
Merge pull request #43 from BradyBrenot/master
fix Win32 issue: disconnected monitors on would cause vector bounds exception
2 parents f4e2fa1 + b9d3210 commit 2770b35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/windows/GetMonitors.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace Screen_Capture {
4242
break;
4343
}
4444
ret.push_back(
45-
CreateMonitor(i, i, devMode.dmPelsHeight, devMode.dmPelsWidth, devMode.dmPosition.x, devMode.dmPosition.y, name, scale));
45+
CreateMonitor(static_cast<int>(ret.size()), i, devMode.dmPelsHeight, devMode.dmPelsWidth, devMode.dmPosition.x, devMode.dmPosition.y, name, scale));
4646
}
4747
}
4848
return ret;

0 commit comments

Comments
 (0)