Open six5536 opened 1 month ago
Node: v20, v22.8.0 node-canvas: v2.11.2
Node crashes when passing canvas with width or height 0 to createPNGStream(). Ok, this is not a valid thing to do, but it should not crash node.
const canvas = new Canvas(12, 0); const out = fs.createWriteStream('image.png'); const stream = canvas.createPNGStream(); stream.pipe(out); out .on('close', () => { console.log('close, happens'); }) .on('finish', () => { console.log('finish, never happens, node crashes'); }) .on('error', () => { console.log('error, never happens, node crashes'); })
Node: v20, v22.8.0 node-canvas: v2.11.2
Node crashes when passing canvas with width or height 0 to createPNGStream(). Ok, this is not a valid thing to do, but it should not crash node.