From de8c6443354540adbc98c73588a2a97447a89cfc Mon Sep 17 00:00:00 2001 From: winscripter <142818255+winscripter@users.noreply.github.com> Date: Mon, 31 Aug 2026 20:35:19 +0400 Subject: [PATCH] Use Math.DivRem --- .../Formats/Jxl/Processing/Decoder/JxlDecoderCore.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlDecoderCore.cs b/src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlDecoderCore.cs index 7fb1775e0..8dcd47711 100644 --- a/src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlDecoderCore.cs +++ b/src/ImageSharp/Formats/Jxl/Processing/Decoder/JxlDecoderCore.cs @@ -1565,8 +1565,10 @@ internal sealed class JxlDecoderCore : ImageDecoderCore, IDisposable } long totalBits = reader.TotalBitsConsumed; - this.AdvanceCodeStream(totalBits / JxlMath.BitsPerByte); - this.codestreamBitsAhead = totalBits % JxlMath.BitsPerByte; + (long div, long rem) = Math.DivRem(totalBits, JxlMath.BitsPerByte); + + this.AdvanceCodeStream(div); + this.codestreamBitsAhead = rem; this.gotTransformData = true; }