justadudewhohacks / justadudewhohacks/opencv4nodejs

nodejs dies if there is no memory to allocate for Mat

Open
#697 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

```
const cv = require('opencv4nodejs');
const emptyMat = new cv.Mat(100000, 100000, cv.CV_8UC3);
```
This will crash your nodejs. As far as I know in the last versions of opencv its possible to handle the error, this may make our applications more reliable I think.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the provided Node.js snippet, then trace the Mat construction path in the native binding and inspect how allocation failures are handled. Done means an oversized Mat allocation reports an error without terminating the Node.js process; the payload names no specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, nodejs
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.