mirror of https://github.com/VERT-sh/VERT.git
fix: single image/size ico conversion memory leak (#252)
why was it being read like this. fixes #252
This commit is contained in:
parent
ed9e18c052
commit
35ccc6f709
|
|
@ -65,22 +65,12 @@ const handleMessage = async (
|
||||||
// special ico handling to split them all into separate images
|
// special ico handling to split them all into separate images
|
||||||
if (from === ".ico") {
|
if (from === ".ico") {
|
||||||
const imgs = MagickImageCollection.create();
|
const imgs = MagickImageCollection.create();
|
||||||
|
imgs.read(
|
||||||
while (true) {
|
new Uint8Array(buffer),
|
||||||
try {
|
new MagickReadSettings({
|
||||||
const img = MagickImage.create(
|
format: MagickFormat.Ico,
|
||||||
new Uint8Array(buffer),
|
}),
|
||||||
new MagickReadSettings({
|
);
|
||||||
format: MagickFormat.Ico,
|
|
||||||
frameIndex: imgs.length,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
imgs.push(img);
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
} catch (_) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (imgs.length === 0) {
|
if (imgs.length === 0) {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue