Просмотр исходного кода

Fix AstcDecoder Success property never being set to true

gdkchan 6 лет назад
Родитель
Сommit
53bbc1311f
1 измененных файлов с 9 добавлено и 2 удалено
  1. 9 2
      Ryujinx.Graphics.Texture/Astc/AstcDecoder.cs

+ 9 - 2
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;