aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2021-03-10 00:24:46 +0000
committerGitHub <noreply@github.com>2021-03-10 01:24:46 +0100
commitdbce3455ada55822cd613095c5b16c169e76c60d (patch)
tree2a70079f8279a9f4825603f69742e3392c663298
parentede26556f2b521f223d39d08c7cba2453628462d (diff)
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.
-rw-r--r--Ryujinx.Graphics.Texture/LayoutConverter.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Texture/LayoutConverter.cs b/Ryujinx.Graphics.Texture/LayoutConverter.cs
index ed046fb5..fb25541b 100644
--- a/Ryujinx.Graphics.Texture/LayoutConverter.cs
+++ b/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];