mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-17 03:00:13 +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);
|
||||
|
||||
const imgData = new ImageData(new Uint8ClampedArray(result.buffer), result.width, result.height);
|
||||
|
||||
module.free_result();
|
||||
|
||||
return new ImageData(new Uint8ClampedArray(result.buffer), result.width, result.height);
|
||||
return imgData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user