fixed crash error condition

fixed crash error condition when file length % 4 != 0