From d636aaf6b832999fd812fbda24a3bff43ff3a234 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 19 Nov 2018 01:19:06 -0300 Subject: [PATCH] Allow size mismatch on frame copy --- Ryujinx.Graphics/VDec/VideoDecoder.cs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Ryujinx.Graphics/VDec/VideoDecoder.cs b/Ryujinx.Graphics/VDec/VideoDecoder.cs index 701cc4e8f9..71a44e5618 100644 --- a/Ryujinx.Graphics/VDec/VideoDecoder.cs +++ b/Ryujinx.Graphics/VDec/VideoDecoder.cs @@ -237,22 +237,10 @@ namespace Ryujinx.Graphics.VDec return; } - if ((uint)OutputConfig.SurfaceWidth > (uint)Frame.Width || - (uint)OutputConfig.SurfaceHeight > (uint)Frame.Height) - { - string Msg = "Surface and frame resolution mismatch!"; - - Msg += $" Surface resolution is {OutputConfig.SurfaceWidth}x{OutputConfig.SurfaceHeight},"; - - Msg += $" Frame resolution is {Frame.Width}x{Frame.Height}."; - - throw new InvalidOperationException(Msg); - } - int HalfSrcWidth = Frame.Width / 2; - int HalfWidth = OutputConfig.SurfaceWidth / 2; - int HalfHeight = OutputConfig.SurfaceHeight / 2; + int HalfWidth = Frame.Width / 2; + int HalfHeight = Frame.Height / 2; int AlignedWidth = (OutputConfig.SurfaceWidth + 0xff) & ~0xff; @@ -264,7 +252,7 @@ namespace Ryujinx.Graphics.VDec int Src = Y * Frame.Width; int Dst = Y * AlignedWidth; - int Size = OutputConfig.SurfaceWidth; + int Size = Frame.Width; Buffer.MemoryCopy(Frame.LumaPtr + Src, LumaPtr + Dst, Size, Size); }