mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-19 19:15:08 +00:00
Reject non-positive camera sizes early
Throw an exception on parsing if the camera size dimensions are not both positive.
This commit is contained in:
parent
09741bc805
commit
c15df01171
1 changed files with 3 additions and 0 deletions
|
@ -475,6 +475,9 @@ public class Options {
|
|||
}
|
||||
int width = Integer.parseInt(tokens[0]);
|
||||
int height = Integer.parseInt(tokens[1]);
|
||||
if (width <= 0 || height <= 0) {
|
||||
throw new IllegalArgumentException("Invalid non-positive size dimension: \"" + size + "\"");
|
||||
}
|
||||
return new Size(width, height);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue