Explorar o código

Fix lineSize for LinearStrided -> Linear conversion (#2091)

Fixes a possible crash when width is greater than stride, which can happen due to alignment when copying textures.
riperiperi %!s(int64=5) %!d(string=hai) anos
pai
achega
dbce3455ad
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Ryujinx.Graphics.Texture/LayoutConverter.cs

+ 1 - 1
Ryujinx.Graphics.Texture/LayoutConverter.cs

@@ -256,7 +256,7 @@ namespace Ryujinx.Graphics.Texture
             int h = BitUtils.DivRoundUp(height, blockHeight);
 
             int outStride = BitUtils.AlignUp(w * bytesPerPixel, HostStrideAlignment);
-            int lineSize = w * bytesPerPixel;
+            int lineSize = Math.Min(stride, outStride);
 
             Span<byte> output = new byte[h * outStride];