You are reading 4 bytes below, I would expect the condition to be `avail - ext_off < 4`.