[APU] Shuffle checks to hopefully prevent crashing from logger

This commit is contained in:
Gliniak 2022-12-11 21:06:47 +01:00
parent c9cd6f15fc
commit 43d7fc5158
1 changed files with 11 additions and 8 deletions

View File

@ -355,6 +355,17 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) {
: nullptr;
uint8_t* current_input_buffer = data->current_buffer ? in1 : in0;
if (!current_input_buffer) {
XELOGE("XmaContext {}: Error - input buffer pointer is invalid!", id());
return;
}
if (!data->output_buffer_block_count) {
XELOGE("XmaContext {}: Error - Received 0 for output_buffer_block_count!",
id());
return;
}
XELOGAPU(
"Processing context {} (offset {}, buffer {}, ptr {:p}, output buffer "
"{:08X}, output buffer count {})",
@ -362,14 +373,6 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) {
current_input_buffer, data->output_buffer_ptr,
data->output_buffer_block_count);
if (!current_input_buffer) {
return;
}
if (!data->output_buffer_block_count) {
XELOGE("XmaContext {}: Error - Received 0 for output_buffer_block_count!",
id());
return;
}
size_t input_buffer_0_size =
data->input_buffer_0_packet_count * kBytesPerPacket;
size_t input_buffer_1_size =