mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-17 13:34:20 +01: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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user