diff --git a/src/xenia/apu/xma_context.cc b/src/xenia/apu/xma_context.cc index b8fa080a8..cc6b80271 100644 --- a/src/xenia/apu/xma_context.cc +++ b/src/xenia/apu/xma_context.cc @@ -851,6 +851,12 @@ std::tuple XmaContext::GetPacketFrameCount(uint8_t* packet) { if (stream.Read(1) == 0) { return {frame_count, false}; } + // There is a case when frame ends EXACTLY at the end of packet. + // In such case we shouldn't increase frame count by additional not existing + // frame and don't mark it as splitted, but as a normal frame + if (!stream.BitsRemaining()) { + return {frame_count, false}; + } } }