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.
This commit is contained in:
PixelyIon 2021-10-27 16:18:20 +05:30
parent 1f3519e6e3
commit df64ff5d14

View File

@ -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<UpdateDataHeader *>(output) = outputHeader;
output += sizeof(UpdateDataHeader);