That change looks suspicious. If switching to i+1 fixes a problem, the real problem is that the if-statement in question gets entered in the first place. Some bounds checking on the outer for-loop (the one which loops through nCfgs and nMaxFormats), is probably wrong then. I had issues with this part in the past, so there maybe a small typo (it may just be off by 1).
Roderick