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:
Romain Vimont 2024-10-11 22:51:15 +02:00
parent 09741bc805
commit c15df01171

View File

@ -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);
}