Added patch to reallocate buffer when adding records to AVI files.