From 7b8749d8dce01f002da88671cc04208ef229774e Mon Sep 17 00:00:00 2001 From: winscripter <142818255+winscripter@users.noreply.github.com> Date: Mon, 31 Aug 2026 20:31:47 +0400 Subject: [PATCH] Don't use stackalloc for two bytes This avoids the stack cookie --- src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlDecoderCore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlDecoderCore.cs b/src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlDecoderCore.cs index 5578f4753..a057a270f 100644 --- a/src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlDecoderCore.cs +++ b/src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlDecoderCore.cs @@ -1505,7 +1505,7 @@ internal sealed class JxlDecoderCore : ImageDecoderCore, IDisposable { if (!this.gotCodestreamSignature) { - Span fileSignature = stackalloc byte[2]; + Span fileSignature = [0, 0]; stream.ReadExactly(fileSignature); if (fileSignature[0] != 0xFF || fileSignature[1] != JxlShared.CodestreamMarker)