From 53bbc1311f9819ac70fd51ae016e8c2070268086 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 29 Dec 2019 14:48:26 -0300 Subject: [PATCH] Fix AstcDecoder Success property never being set to true --- Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs b/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs index 4ba332d07b..74623b38f5 100644 --- a/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs +++ b/Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs @@ -32,9 +32,14 @@ namespace Ryujinx.Graphics.Texture.Astc int depth, int levels) { - if ((uint)blockWidth > 12 || (uint)blockHeight > 12) + if ((uint)blockWidth > 12) { - throw new AstcDecoderException("Invalid block size."); + throw new ArgumentOutOfRangeException(nameof(blockWidth)); + } + + if ((uint)blockHeight > 12) + { + throw new ArgumentOutOfRangeException(nameof(blockHeight)); } InputBuffer = inputBuffer; @@ -45,6 +50,8 @@ namespace Ryujinx.Graphics.Texture.Astc Levels = new AstcLevel[levels]; + Success = true; + TotalBlockCount = 0; int currentInputBlock = 0;