From 75f0c40e6fe9060a5eb1d41e02a09dfa11dc5e80 Mon Sep 17 00:00:00 2001 From: Raphtaliyah Date: Mon, 13 Jul 2026 15:10:07 +0200 Subject: [PATCH] Fix LZX uncompressed block padding handling for odd sized final blocks --- Library/DiscUtils.Core/Compression/LzxDecoder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/DiscUtils.Core/Compression/LzxDecoder.cs b/Library/DiscUtils.Core/Compression/LzxDecoder.cs index a66d8dd47..29308b85c 100644 --- a/Library/DiscUtils.Core/Compression/LzxDecoder.cs +++ b/Library/DiscUtils.Core/Compression/LzxDecoder.cs @@ -236,7 +236,7 @@ private bool DecodeUncompressedBlock( if ((blockSize & 1) != 0) { - if (!reader.TryReadRawByte(out _)) + if (remainingOutput - bytesToStore > 0 && !reader.TryReadRawByte(out _)) { return false; }