Simple LED cycle code randomly stopping

Ranges look a little funny.
You have leds[0] thru leds[4] defined.
You write to leds[5], leds[6] & leds[7] tho.
That usually creates a problem, overwriting something else stored in SRAM.