fix: init/free config
This commit is contained in:
parent
8720d831ac
commit
44e4675d2f
|
@ -28,6 +28,8 @@ internal static class WebPHelper {
|
||||||
rgba = new byte[width * height * 4];
|
rgba = new byte[width * height * 4];
|
||||||
|
|
||||||
var decoderConfig = default(WebPDecoderConfig);
|
var decoderConfig = default(WebPDecoderConfig);
|
||||||
|
Native.WebPInitDecoderConfig(ref decoderConfig);
|
||||||
|
using var free = new OnDispose(() => Native.WebPFreeDecBuffer(ref decoderConfig.output));
|
||||||
decoderConfig.input = features;
|
decoderConfig.input = features;
|
||||||
decoderConfig.output.colorSpace = WebpCspMode.ModeRgba;
|
decoderConfig.output.colorSpace = WebpCspMode.ModeRgba;
|
||||||
decoderConfig.output.isExternalMemory = 1;
|
decoderConfig.output.isExternalMemory = 1;
|
||||||
|
|
Loading…
Reference in New Issue