From df64ff5d1433b25456ce8e40b3033eb320c17340 Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Wed, 27 Oct 2021 16:18:20 +0530 Subject: [PATCH] Zero-Fill `IAudioRenderer::RequestUpdate` Output Buffer Some titles don't clear the output buffer prior to submission, as the service is expected to fill all of it in, our audren implementation is incomplete and doesn't end up doing this leaving the contents of the buffer to be undefined leading to UB in the form of SEGFAULTs or the application throwing a fatal error. This has been patched over by 0-filling the buffer which is a sane default value for the fields that aren't filled in albeit not a replacement for a proper audren implementation. --- .../cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp b/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp index 842c4f39..b170b471 100644 --- a/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp +++ b/app/src/main/cpp/skyline/services/audio/IAudioRenderer/IAudioRenderer.cpp @@ -94,6 +94,7 @@ namespace skyline::service::audio::IAudioRenderer { outputHeader.elapsedFrameCountInfoSize; auto output{request.outputBuf.at(0).data()}; + std::memset(output, 0, request.outputBuf.at(0).size()); *reinterpret_cast(output) = outputHeader; output += sizeof(UpdateDataHeader);