From 7ac1198e74973e54872ab3ab4f75c18299af5e06 Mon Sep 17 00:00:00 2001 From: QDarkRex Date: Sun, 27 Sep 2026 12:24:15 +0700 Subject: [PATCH] fix(audioout): reject zero sample count and frequency in sceAudioOutOpen A zero frequency was stored and later used as a divisor when computing the output block duration. Return SCE_AUDIO_OUT_ERROR_INVALID_SIZE and SCE_AUDIO_OUT_ERROR_INVALID_SAMPLE_FREQ instead. Co-Authored-By: Claude Opus 5.5 --- core/libs/prx/libSceAudioOut/src/AudioOut.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/libs/prx/libSceAudioOut/src/AudioOut.cpp b/core/libs/prx/libSceAudioOut/src/AudioOut.cpp index 64478c4b4..4fd24c497 100644 --- a/core/libs/prx/libSceAudioOut/src/AudioOut.cpp +++ b/core/libs/prx/libSceAudioOut/src/AudioOut.cpp @@ -273,6 +273,12 @@ int APS5_VABI sceAudioOutOpen(int userId, int type, int index, std::uint32_t len if (!portTypeValid(type)) { return -2144993270; } + if (len == 0) { + return -2144993274; + } + if (freq == 0) { + return -2144993272; + } if (index != 0) { throw std::runtime_error("sceAudioOutOpen: index != 0 not supported"); }