The write block (context word 0, bits 27-31) was used as it is for the first block of a pass, so one at or past the ring size (bits 22-26) was written past the ring's end, possibly into another APU allocation, before it wrapped with (write + 1) % size. Take it modulo the ring first, as the read block is taken, and as advance_read does. (cherry picked from commit 7a5d85e6a2867081ed54515ce7f33bae3fcb643d)