From 54de07d4eae2fa04abeb1ea1e4b45f7e19f67dbe Mon Sep 17 00:00:00 2001 From: shenweip <1037567878@qq.com> Date: Tue, 3 Mar 2020 17:15:14 +0800 Subject: [PATCH] Attempt to replace 0 frame width with valid frame width.(sceMpegAvcCsc) Fixes #12627. --- Core/HLE/sceMpeg.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index 5243c76f03..c84d6abc3c 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -1939,6 +1939,14 @@ static u32 sceMpegAvcCsc(u32 mpeg, u32 sourceAddr, u32 rangeAddr, int frameWidth DEBUG_LOG(ME, "sceMpegAvcCsc(%08x, %08x, %08x, %i, %08x)", mpeg, sourceAddr, rangeAddr, frameWidth, destAddr); + if (frameWidth == 0) { + if (!ctx->defaultFrameWidth) { + frameWidth = ctx->avc.avcDetailFrameWidth; + } else { + frameWidth = ctx->defaultFrameWidth; + } + } + int x = Memory::Read_U32(rangeAddr); int y = Memory::Read_U32(rangeAddr + 4); int width = Memory::Read_U32(rangeAddr + 8);