Typical error when there is a problem with the AVI, even though it appears to p-lay okay.
Load the avi into VDub or Nandub (if you get an audio error when loaded), set Video & Audio to Direct Stream Copy and then Save AVI. This just basically re-muxes the Video & Audio and can "clean up" an AVI simply. Then try encoding that again. If still a problem, set Video & Audio to Full Processing Mode, for Video compression set to Xvid at a bitrate a bit bigger than the original, then Save AVI. Can take an hour to reencode.
I assume you have tried DivFix and DivXRepair on a copy of the AVI already ?