[XMA] Swap input buffer on unresolvable split headers

This commit is contained in:
Herman S.
2026-02-21 00:41:55 +09:00
parent d68ff7243a
commit 6265698eef

View File

@@ -473,8 +473,13 @@ void XmaContextNew::Decode(XMA_CONTEXT_DATA* data) {
const uint8_t* next_packet =
GetNextPacket(data, next_packet_index, current_input_packet_count);
if (!next_packet) {
// Matching split-body error handling below; correct error code unknown.
data->error_status = 4;
// Next buffer not available yet. We can't resolve the split header
// without it, so consume (swap) the current buffer and move on.
XELOGAPU(
"XmaContext {}: Split frame header at packet {}, next buffer "
"unavailable — swapping input buffer",
id(), packet_index);
SwapInputBuffer(data);
return;
}
std::memcpy(input_buffer_.data(), packet + kBytesPerPacketHeader,