mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-17 11:09:41 +00:00
Fix use-after-free in imagequant
This commit is contained in:
committed by
Ingvar Stepanyan
parent
45785bcca3
commit
4fc18de5f9
@@ -15,7 +15,9 @@ export async function process(data: ImageData, opts: QuantizeOptions): Promise<I
|
|||||||
:
|
:
|
||||||
module.quantize(data.data, data.width, data.height, opts.maxNumColors, opts.dither);
|
module.quantize(data.data, data.width, data.height, opts.maxNumColors, opts.dither);
|
||||||
|
|
||||||
|
const imgData = new ImageData(new Uint8ClampedArray(result.buffer), result.width, result.height);
|
||||||
|
|
||||||
module.free_result();
|
module.free_result();
|
||||||
|
|
||||||
return new ImageData(new Uint8ClampedArray(result.buffer), result.width, result.height);
|
return imgData;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user