This doesn't neccessarily mean the file is corrupt . Maybe your code is generating that error . Check for overflow values , you might need to turn option strict on for this purpose .