source-overlay: handle wrap around infinite loop.