Version
1.0.0
Short overview
Selecting invalid regions of an image (e.g. bigger than the actual image) causes uncaught runtime errors
Detailed error description
When providing a ROI which exceeds an images size, nut.js does no checks to prevent invalid memory access.
This leads to uncaught std::runtime_errors
Steps to reproduce error
describe("Invalid ROI test", () => {
it("should trigger a runtime error", async () => {
// GIVEN
const SUT = new TemplateMatchingFinder();
const imagePath = path.resolve(__dirname, "./__mocks__/save_as.png");
const minConfidence = 0.99;
const vision = new ScreenAction();
const haystack = await vision.grabScreen();
const matchRequest = new MatchRequest(
haystack,
imagePath,
new Region(0, 0, haystack.width, haystack.height),
minConfidence
);
// WHEN
await SUT.findMatch(matchRequest, true);
// THEN
// libc++abi.dylib: terminating with uncaught exception of type std::runtime_error
});
});
Additional content
Please provide any (mandatory) additional data to reproduce the error (Dockerfiles etc.)
Version
1.0.0
Short overview
Selecting invalid regions of an image (e.g. bigger than the actual image) causes uncaught runtime errors
Detailed error description
When providing a ROI which exceeds an images size, nut.js does no checks to prevent invalid memory access.
This leads to uncaught std::runtime_errors
Steps to reproduce error
Additional content